XSLT <xsl:stylesheet>and<xsl:transform>Element


XSLT 元素参考手册Complete XSLT Element Reference

Definition and Usage

The <xsl:stylesheet> and <xsl:transform> elements are completely synonymous elements. Both are used to define the root element of a stylesheet.


Syntax

<xsl:stylesheet
id="name"
version="version"
extension-element-prefixes="list"
exclude-result-prefixes="list">

<!-- Content:(<xsl:import>*,top-level-elements) -->

</xsl:stylesheet>

<xsl:transform
id="name"
version="version"
extension-element-prefixes="list"
exclude-result-prefixes="list">

<!-- Content:(<xsl:import>*,top-level-elements) -->

</xsl:transform>

Attributes

Attributes Value Description
version version Required. Specifies the XSLT version of the stylesheet.
extension-element-prefixes list Optional. A whitespace-separated list of namespace prefixes for extension elements.

Netscape 6 does not support this attribute.

exclude-result-prefixes list Optional. A whitespace-separated list of namespace prefixes that should not appear in the output.
id name Optional. A unique id for the stylesheet.

Netscape 6 does not support this attribute.

Example 1

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

....

....

</xsl:stylesheet>

Example 2

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

....

....

</xsl:transform>


XSLT 元素参考手册Complete XSLT Element Reference Other Extensions