Subject: Re: [xsl] numerating nodes in doc-flow From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Thu, 25 Jan 2007 13:53:49 +0000 |
Hello guys!
I have to enumerate nodes in the document-flow order using xslt 1.0. I thought that's not difficult but the following template does nothing. Can you help me?
<xsl:template match="node()"> <xsl:param name="counter" select="0"/> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:attribute name="new_id" select="concat('item_', $counter)"/> <xsl:apply-templates select="occurrence/art"> <xsl:with-param name="counter" select="$counter+1"/> </xsl:apply-templates> </xsl:copy> </xsl:template>
Without sample input or output XML it's difficult to give a good answer, but its likely <xsl:number count="*" level="any"/> will give you the numbering you're after.
cheers andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] numerating nodes in doc-flow, Alexey Nickolaenkov | Thread | Re[2]: [xsl] numerating nodes in do, Alexey Nickolaenkov |
Re: [xsl] Generating a unique listi, Glen Mazza | Date | Re[2]: [xsl] numerating nodes in do, Alexey Nickolaenkov |
Month |