[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Generating attributes from the position of an elem

Subject: Re: Generating attributes from the position of an element
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 01 Jun 2010 09:29:11 +0100
Re:  Generating attributes from the position of an elem
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.