RE: Problems grouping adjacent siblings
> I would like to group adjacent siblings which share the same > local-name > into a container element. > > I thought that this would be the classical use-case for an > <xsl:for-each-group> with @group-adjacent, but I am getting the > strangest results... I can't tell what you are doing wrong without seeing your code. With ax as the context node, you can do <xsl:for-each-group select="*" group-adjacent="local-name()"> <xsl:choose> <xsl:when test="current-grouping-key()='ex'"> <remark><xsl:copy-of select="current-group()"/></remark> </ <xsl:otherwise> <xsl:copy-of select="current-group()"/> </ </ </ Michael Kay http://www.saxonica.com/
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format