| <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 | |
|
|
| Optional Attributes | |
Defines any namespace prefixes used to invoke extension elements. Multiple namespace prefixes are separated by whitespace. |
|
| Content | |
|
This element contains the entire stylesheet. The following items can be children of <xsl:stylesheet>:
|
|
| Appears in | |
|
None. <xsl:stylesheet> is the root element of the stylesheet. |
|
| Defined in | |
|
XSLT section 2.2, Stylesheet Element. |
|
| Example | |
|
For the sake of completeness, we'll include an example here. We'll use the Hello World document from the XML 1.0 specification for our example: <?xml version="1.0"?> <greeting> Hello, World! </greeting> We'll transform our document with this stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:apply-templates select="greeting"/>
</xsl:template>
<xsl:template match="greeting">
<html>
<body>
<h1>
<xsl:value-of select="."/>
</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
When we transform our document with this stylesheet, here are the results: <html> <body> <h1> Hello, World! </h1> </body> </html> |
|