Jongware wrote:
> Hi all,
>
> Given an xml file with a linear set
>
> <a>1</a>
> <b>2</b>
> <b>3</b>
> <b>4</b>
> <a>5</a>
> <b>6</b>
> <b>7</b>
>
> how do I get separate groups to work on of the first set of tags from
> <a>(1) to <b>(4) and the second set from <a>(5) to <b>7?
> XSLT2.0 is no problem, I'm using Saxon 8.0 (and so far blissfully
> unaware of any limitations it may have with 2.0).
Saxon 8.9 is the first Saxon version to implement the W3C standard XSLT
2.0 and XPath 2.0 so if you want to use XSLT 2.0 then I recommend to
upgrade to the current release 9.2 of Saxon.
As for the problem, XSLT 2.0 has
<xsl:for-each-group select="*" group-starting-with="a">
<group>
<xsl:copy-of select="current-group()"/>
</group>
</xsl:for-each-group>
You could use that code inside a template matching the common parent
element of the nodes you have shown.
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/