[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Generating attributes from the position of an element


Subject: Re: [xsl] Generating attributes from the position of an element
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 01 Jun 2010 09:29:11 +0100

I have the following xml file and wish to generate ID-s based on the
position to the<w>  elements with the following XSL file, however, the
end result of the ID attribute is always 1, I have no idea why.


The reason the value is always 1 is that the @ID attribute is always at position 1 in the list of nodes selected by


<xsl:apply-templates select="@*|node()|comment()|processing-instruction()"/>

If you want the position in the source tree of the parent element of the @ID attribute, try<xsl:number/>.

Michael Kay
Saxonica Limited


Current Thread
Keywords