[Home] [By Thread] [By Date] [Recent Entries]
Ramkumar.V wrote:
Below are the inputs. I need to generate sequential ID for all the sect element including any nesting element sec/sec/sec for sec2 sec 3 sec4
And instead of the xsl:choose and ancestor check you could simply write different templates e.g. <xsl:template match="body/sect"> <xsl:variable name="pos"><xsl:number level="any"/></xsl:variable> <sect1 id="sect{$pos}"> <xsl:apply-templates/> </sec1> </xsl:template> <xsl:template match="body/sect/sect"> <xsl:variable name="pos"><xsl:number level="any"/></xsl:variable> <sect2 id="sect{$pos}"> <xsl:apply-templates/> </sec2> </xsl:template> and so on for the other levels. -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|

Cart



