XSLT <xsl:stylesheet> en <xsl:transform> elementen

Definitie en gebruik

De <xsl:stylesheet> en <xsl:transform> elementen zijn volledig synoniem. Beide worden gebruikt om de wortelelement van de stijltafel te definiëren.

语法

<xsl:stylesheet
id="name"
version="version"
extension-element-prefixes="list"
exclude-result-prefixes="list"
  <xsl:import>*,top-level-elements</xsl:import>
</xsl:stylesheet>
<xsl:transform
id="name"
version="version"
extension-element-prefixes="list"
exclude-result-prefixes="list"
  <xsl:import>*,top-level-elements</xsl:import>
</xsl:transform>

Attribute

Attribute Value Description
version version Required. Specifies the XSLT version of the stylesheet.
extension-element-prefixes list

Optional. The list of namespace prefixes for extended elements, separated by spaces.

Netscape 6 does not support this attribute.

exclude-result-prefixes list Optional. The list of namespace prefixes that should not appear in the output, separated by spaces.
id name

Optional. The unique id of the stylesheet.

Netscape 6 does not support this attribute.

Instance

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>