|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: conditional increment under XSL for-each loop
anil an.kumar wrote:
I have a requirment which should show the xml o/p like below Here is an XSLT 2.0 stylesheet that produces above output: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output indent="yes"/> <xsl:template match="/"> <instance> <xsl:for-each-group select="//C_TAX_REPORTING_NAME" group-by="(position() - 1) idiv 2"> <mezo eazon="{format-number(current-grouping-key() + 1, '000')}X1A"> <xsl:value-of select="current-group()[1]"/> </mezo> <mezo eazon="{format-number(current-grouping-key() + 1, '000')}X2A"> <xsl:value-of select="current-group()[2]"/> </mezo> </xsl:for-each-group> </instance> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
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
|

Cart








