|
January 1, 2002 Setting Variables in XSLT Tips: January 2002
Yehuda Shiran, Ph.D.
|
|
XSLT supports variables. You can set a variable in one place and reuse it somewhere else. Use variables to make your code more flexible and well-organized. You define a variable with the xsl:param tag. You position this tag in the front section of your script, before the HEAD statament. Here is an example:
And here is an example for the whole front section:
You use a variable by prefixing its name with a $ sign. For example:
People who read this tip also read these tips: Look for similar tips by subject: |