[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Indexing in xsl
><orders order1-id="1" order2-id="2" order2-id="3" order2-id="4" /> Well, if you meant: <orders order1-id="1" order2-id="2" order3-id="3" order4-id="4" /> Then you could use: <xsl:template match="orders"> <xsl:copy> <xsl:for-each select="order"> <xsl:attribute name="{concat(local-name(), position(), '-','id')}"> <xsl:value-of select="@id"/> </xsl:attribute> </xsl:for-each> </xsl:copy> </xsl:template> You were nearly right, you just needed to use position() instead of a var to get the incrementing value. cheers andrew === --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/02 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|