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

version

Defines 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 returns Infinity. Using <xsl:value-of version="1.0" ...> ensures that version 1.0 processing is used.

Note

Although the <xsl:output> element has a version attribute, it specifies the value of the version attribute in the output. For example, <xsl:output method="xml" version="1.1"> creates a result document with an XML declaration of <?xml version="1.1" ...?>.

exclude-result-prefixes

Lists the prefixes of namespaces that should not be copied to the output. Typically used on the <xsl:stylesheet> element only.

extension-element-prefixes

Defines 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-namespace

Defines the default namespace used in XPath expressions and patterns. ...

Get XSLT, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.