[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSLT transformation using counters
Hi, I can't seem to get a handle on how to set a counter or variable then then output the results. I have a XML file (snippet) tagged like so: Input: <body> <lev> <hd>heading</hd> <lev> <hd>heading</hd> <lev> <hd>heading</hd> <lev> <hd>heading</hd> </lev> </lev> </lev> </lev> </body> How can I set a counter and insert the results in the <HD?> tag below? Output: <body> <lev> <hd1>heading</hd> <lev> <hd2>heading</hd> <lev> <hd3>heading</hd> <lev> <hd4>heading</hd> </lev> </lev> </lev> </lev> </body> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="div"> <xsl:text disable-output-escaping="yes"> <ParaStyle:div></xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="div"> <xsl:text disable-output-escaping="yes"> <ParaStyle:div></xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="heading"> <xsl:text disable-output-escaping="yes"> <ParaStyle:hd1></xsl:text> <xsl:apply-templates/> </xsl:template>
|
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
|