October 21, 2016
Hot Topics:


  • November 19, 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.

Sitemap | Contact Us

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