Name
[2.0] Attributes common to all XSLT elements
There are six standard attributes that can be used on any XSLT
element; we’ll define them here rather than redefine them for every
XSLT element. While these attributes can be used on any XSLT element,
they are normally used on elements such as <xsl:stylesheet> and <xsl:template>.
Attributes
versionDefines the version of XSLT used to process this element. This is useful when you want a particular XSLT element to be processed using the rules of a particular version of the standard. For example,
<xsl:value-of select="1 div 0"/>works differently in XSLT 1.0 and 2.0. XSLT 2.0 treats this as a fatal error, while XSLT 1.0 returnsInfinity. Using<xsl:value-of version="1.0" ...>ensures that version 1.0 processing is used.Note
Although the
<xsl:output>element has aversionattribute, it specifies the value of theversionattribute in the output. For example,<xsl:output method="xml" version="1.1">creates a result document with an XML declaration of<?xmlversion="1.1" ...?>.exclude-result-prefixesLists the prefixes of namespaces that should not be copied to the output. Typically used on the
<xsl:stylesheet>element only.extension-element-prefixesDefines the namespace prefixes that identify extension elements. The XSLT processor uses these namespaces to identify code that provides additional processing. Typically used on the
<xsl:stylesheet>element only.xpath-default-namespaceDefines the default namespace used in XPath expressions and patterns. ...
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.
Read now
Unlock full access