WebReference.com - Excerpt from Inside XSLT, Chapter 2, Part 2 (3/5)
XSL stylesheets begin with the XML declaration because they are well-formed XML documents, so planets.xsl starts with this same declaration:
<?xml version="1.0"?> . . .
The XML declaration is stripped off by the XSLT processor
immediately, however, and won't figure in our XSLT discussion. The first
element of an XSL stylesheet that is pure XSL is the
element (not to be confused with the
instruction, which goes in the XML document). Some people have objected
to the name of this element, because it's usually used in XSLT transformations,
so W3C also allows you to refer to this element as
Here's how you use this element:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> . . .
The following list includes the attributes of
id(optional). Used to identify the stylesheet. Set to an XML name.
version(mandatory). Sets the version of XSLT needed to work with the stylesheet. This value is normally set to "1.0" currently. You can also set this value to "1.1"; although, because XSLT 1.1 is not going to go past the working draft stage, this will probably not be a "legal" value as far as W3C is concerned.
extension-element-prefixes(optional). Defines the extensions in the stylesheet used to identify extension elements. Set to a whitespace-separated list of
exclude-result-prefixes(optional). Specifies the namespaces in the stylesheet that should not be copied to the output (unless they are intentionally used in the output document). Set to a whitespace-separated list of
The content of this element can consist of any of the following top-level XSL elements:
<xsl:variable>. XSLT 1.1 added
<xsl:script> to this list.
Created: September 20, 2001
Revised: September 20, 2001