O'Reilly logo

XSLT, 2nd Edition by Doug Tidwell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

<xsl:stylesheet>

The root element of an XSLT stylesheet. It is identical to the <xsl:transform> element, which was included in the XSLT specification for historical purposes.

Category

Contains the entire stylesheet.

Required Attributes

version

Indicates the version of XSLT that the stylesheet requires. For XSLT version 1.0, its value should always be 1.0. As later versions of the XSLT specification are defined, the required values for the version attribute will be defined along with them.

[2.0] In XSLT version 2.0, this value should be 2.0. The XSLT 2.0 spec defines stricter rules for handling the version attribute than the XSLT 1.0 spec. To avoid complications, you should use the values 1.0 and 2.0.

XSLT 2.0 also allows you to specify the version attribute on any XSLT element. If you want to use version 1.0 processing for a given portion of your stylesheet, you can define version="1.0" for that portion of the stylesheet. For example, the <xsl:decimal-format> element works differently in XSLT 2.0, so you could use <xsl:decimal-format version="1.0"> to process the element according to the rules of XSLT 1.0.

xmlns:xsl

Defines the URI for the XSL namespace. For both XSLT version 1.0 and XSLT version 2.0, this attribute’s value must be http://www.w3.org/1999/XSL/Transform. (Although this is a namespace declaration, not an attribute, it is required. Your stylesheet won’t work without it.)

Optional Attributes

id

Defines an ID for this stylesheet.

extension-element-prefixes

Defines any namespace ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required