October 23, 2018
Hot Topics:


  • November 20, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

In XSL, you do have variables but you cannot assign them values at runtime, so I suppose it would be more approriate to call them constants. XSL does have one useful function that returns a number which corressponds to the number of times a loop has occurred:

<xsl:for-eachselect="people/person">    <xsl:value-ofselect="position()"/></xsl:for-each>

Anyway, getting back to variables, you declare them like this:

<xsl:variable name="myvar">myvalue</xsl:variable>

To get the value of a variable use:

<xsl:value-of select="$myvar"/>

Page 5 of 6

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date