<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations 编辑

XSLT/XPath Reference: XSLT elements, EXSLT functions, XPath functions, XPath axes

The <xsl:stylesheet> element (or the equivalent <xsl:transform> element) is the outermost element of a stylesheet.

Namespace Declaration

A pseudo-attribute required to identify the document as an XSLT stylesheet. Typically this is xmlns:xsl="http://www.w3.org/1999/XSL/Transform".

Syntax

<xsl:stylesheet
	version="NUMBER"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	id="NAME"
	extension-element-prefixes="LIST-OF-NAMES"
	exclude-result-prefixes="LIST-OF-NAMES">
		ENTIRE STYLESHEET
</xsl:stylesheet>

Required Attributes

version
Specifies the version of XSLT required by this stylesheet.

Optional Attributes

exclude-result-prefixes
Specifies any namespace used in this document that should not be sent to the output document. The list is whitespace separated.
extension-element-prefixes
Specifies a space-separated list of any namespace prefixes for extension elements in this document.
default-collation
Specifies the default collation used by all XPath expressions appearing in attributes or text value templates that have the element as an ancestor, unless overridden by another default-collation attribute on an inner element. It also determines the collation used by certain XSLT constructs (such as <xsl:key> and xsl:for-each-group) within its scope.
default-mode
Defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope.
default-validation
Defines the default value of the validation attribute of all relevant instructions appearing within its scope.
expand-text
Determines whether descendant text nodes of the element are treated as text value templates.
id
Specifies an id for this stylesheet. This is most often used when the stylesheet is embedded in another XML document.
input-type-annotations
Specifies whether type annotations are stripped from the element so the same results are produced whether the source documents have been validated against a schema or not.
use-when
Determines whether the element and all the nodes that have it as ancestor are excluded from the stylesheet.
xpath-default-namespace
Specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an XPath expression.

Type

Required outermost element of stylesheet.

Specifications

SpecificationStatusComment
XSLT 3.0
The definition of '<xsl:stylesheet>' in that specification.
RecommendationAdded the attributes default-mode, expand-text, and use-when.
XSLT 2.0Added the attributes xpath-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except version optional.
XSLT 1.0Initial definition

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:157 次

字数:5674

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文