Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 16th, 2005, 04:15 PM
Registered User
 
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt variable problems

hi
My problem: Each element needs an id, they follow this pattern: "smenu1,smenu2,smenu3,..."
How can i do this with xsl?


hopefully this demonstates what I need:
<xsl:for-each select="li">
int i = 0;
<dt id =smenu+i >...</dt>
i++;
</xsl:for-each>


cheers
 
Old August 16th, 2005, 04:22 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Try

<dt id="smenu{position()}">



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 17th, 2005, 02:49 AM
Registered User
 
Join Date: Aug 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable scope in XSLT? trufla XSLT 3 October 24th, 2008 01:45 PM
assign XSLT variable to a wml variable arunagottimukkala XSLT 2 October 19th, 2007 05:15 AM
Variable Problems Gobbles Classic ASP Basics 2 September 5th, 2007 09:17 PM
Using variable in XSLT -Need help !!! nobitavn94 XSLT 3 October 16th, 2006 10:32 AM
Variable Problems WIx Beginning PHP 1 July 15th, 2004 10:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.