[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] group-starting-with and ending with
Hi, Is it any possibility to <st> start and end tag in <bb>Test1</bb>, <bb>Test2</bb>. Here is my XML <a><x>To</x> Test, <bb>Test1</bb>, <bb>Test2</bb>, <cc>Test3</cc>, <dd>USA</dd></a> Desired Output <a><x>To</x> Test, <st><bb>Test1</bb>, <bb>Test2</bb></st>, <cc>Test3</cc>, <dd>USA</dd></a> XSLT <xsl:template match="a"> <xsl:element name="{local-name()}"> <xsl:for-each-group select="node()" group-adjacent="self::text() or self::x or self::dd or self::cc"> <xsl:choose> <xsl:when test="current-grouping-key()"> <xsl:copy-of select="current-group()"/> </xsl:when> <xsl:otherwise> <xsl:for-each-group select="*" group-starting-with="self::bb"> <st> <xsl:for-each select="current-group()"> <xsl:copy-of select="current-group()"/> </xsl:for-each> <xsl:copy-of select="current-group()"/> </st> </xsl:for-each-group> <xsl:copy-of select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:element> </xsl:template> Thanks
|
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
|