Can you use variables in XSL. I know about the <xsl:variable command, but I cannot seem to change the value. Is there a way of changing its value or is there another command?
you can't change the value of variables in xsl. this is intentional and is the main idea behind the language is that there are no variables (it's a "functional language".
the <xsl:variable> tag is maybe a confusing name. they should be thought of as references only - so their aim in life is to save you having to type so much when you want to reference the same thing over and over, ie. they really don't change.
you don't need to use traditional variables to do anything in xsl tho. it's hard to explain the thinking behind this approach but if there was anything in particular you need to do then post it. once you see one example it becomes clearer.
Thanks for the info. I sort of figured that you can't change it.
I want to loop through a list of objects, and give each object a unique numeric value for use in HTML. I wanted to do this through variables. Is there another way?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.