Skip to Content
XSLT and XPATH: A Guide to XML Transformations
book

XSLT and XPATH: A Guide to XML Transformations

by John Robert Gardner, Zarella L. Rendon
July 2001
Intermediate to advanced
592 pages
11h 16m
English
Pearson
Content preview from XSLT and XPATH: A Guide to XML Transformations

8.3. Using Variable References

Regardless of how a variable is declared, either with <xsl:variable> or <xsl:param>, or if it is overridden with <xsl:with-param>, the value bound to the variable is accessed using a variable reference.[2] A variable reference is the mechanism used to retrieve the value of a variable. Variable reference takes the form $variable-name, where “variable-name” is the name of the variable declared using the name attribute on the declaring element. Note that this means the variable name is also by definition a QName.

[2] Although variables are defined in XSLT, variable references are the realm of XPath because they are used in expressions.

The template rule in Example 8-3 declares a variable named myparent and gets its ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning XSLT and XPath: Transforming XML Documents and Data

Beginning XSLT and XPath: Transforming XML Documents and Data

Ian Williams
Java and XSLT

Java and XSLT

Eric M. Burke
Learning XSLT

Learning XSLT

Michael Fitzgerald

Publisher Resources

ISBN: 0130404462Purchase book