xsl-list
[Top] [All Lists]

[xsl] regrouping split elements

2009-12-21 12:02:03
Hi there,

I'm trying to up-scale some bibliographic output converted with a
docxtotei stylesheet and then tidy it up somewhat.  The problem is
that the output seems to randomly break in the middle of words.  So
the current output I have is:

<div>
    <p>
        <hi rend="bold">Dibdin</hi>
        <hi rend="bold">, Thomas Jo</hi>
        <hi rend="bold">hn</hi>
    </p>
    <p>
        <hi rend="italic">The </hi>
        <hi rend="italic">widow and the w</hi>
        <hi rend="italic">ill</hi>, published as <hi
rend="italic">Four legs and two l</hi>
        <hi rend="italic">egs</hi>
        <hi rend="italic">.</hi>
    </p>
    <p>1826</p>
<!-- and many more -->
</div>

and obviously I want it more to be something like:


<div>
    <p>
        <hi rend="bold">Dibdin, Thomas John</hi>
    </p>
    <p>
        <hi rend="italic">The widow and the will</hi>, published as
<hi rend="italic">Four legs and two legs.</hi>
    </p>
    <p>1826</p>
<!-- and many more -->
</div>

(and you can guess that I'm going to change anything in bold to be
authors and anything in italics to be a title...then group them into
individual entries.)

But to get this first step done, I've started out a number of
different ways before hitting stumbling blocks with
previous/following-sibling.  Is the right approach (in XSLT2) instead
to do something like xsl:for-each-group on the value of hi/@rend
inside each 'p'?

Any thoughts appreciated,
-James

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>