[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Grouping - starting with certain element and endin
> So I want to keep the order of all elements but group each <IDM> > element followed by a number of siblings up to another <IDM>, a <LV2> > or a <LV3> element and wrap this sequence in a <phrase> section. The XSLT 2.0 solution that comes to mind is: <xsl:for-each-group group-starting-with="IDM|LV2|LV3"> <xsl:choose> <xsl:when test="self::IDM"> <phrase> <xsl:copy-of select="current-group()"/> </phrase> </xsl:when> <xsl:otherwise> <xsl:copy-of select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-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
|