Subject: [xsl] Counting nodes efficiently From: Brian Grainger <granam@xxxxxxxxxxxxx> Date: Wed, 18 Feb 2004 13:06:54 -0700 |
<xsl:template match="*"> <xsl:variable name="name" select="name()" /> <xsl:element name="{name()}"> <xsl:attribute name="id"> <xsl:value-of select="concat($name, '-', count(preceding::*[name()= $name]) + count(ancestor::*[name()= $name]))" /> </xsl:attribute> <xsl:apply-templates /> </xsl:element> </xsl:template>
Regards, Brian
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XML validation, David . Pawson | Thread | Re: [xsl] Counting nodes efficientl, David Carlisle |
Re: [xsl] XML validation, Wendell Piez | Date | Re: [xsl] XML validation, Wendell Piez |
Month |