I have a blind spot when it comes to grouping flat XML structure using XSLT
1.0.
My source XML structure is typically as follows (simplified for clarity):
<section>
<title/>
<warning/>
<warning/>
<para/>
<warning/>
<warning/>
<para/>
<para/>
</section>
I would like to group adjacent <warning> elements to give this structure:
<section>
<title/>
<w-group>
<warning/>
<warning/>
</w-group>
<para/>
<w-group>
<warning/>
<warning/>
</w-group>
<para/>
<para/>
</section>
I've tried using Muenchian Grouping, but I'm going wrong somewhere. I
started by trying to identify the start of each group using <xsl:template
match="warning[(preceding-sibling::*[1])[not(self::warning)]]">... As a
starting point is this correct, it does seem to capture the first warning in
each group? After that I cannot grab the following <warning> sibling
elements correctly.
For this project I am stuck with XSLT 1.0 and Xalan-C
Thanks for all help.
Ian
--~------------------------------------------------------------------
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>
--~--