xsl:include¶
Used to include the contents of one stylesheet within another.
Available in XSLT 1.0 and later versions. Available in all Saxon editions.
- Category: declaration
- Content: none
- Permitted parent elements:
xsl:package;xsl:stylesheet;xsl:transform
Attributes¶
href- uri
- A URL (absolute or relative) of another stylesheet to be textually included within this one.
- To customize the way in which the href attribute is handled, a user-written
URIResolvercan be supplied (or on .NET, anXMLResolver). Note that it is the compile-timeURIResolverthat is used, not the run-timeURIResolver. - If the URI is relative, then it is interpreted relative to the base URI of the
xsl:includeelement itself, which normally is the location of the file containing the source stylesheet module. If the stylesheet is loaded other than from a file (for example, if it is supplied as a string literal in the source of the application program that invokes the transformation), then a base URI should be supplied when invoking the compilation.
Details¶
The xsl:include element is always used at the top level of the stylesheet. The top-level elements of the included stylesheet effectively replace the xsl:include element.
The xsl:include element may also be used at the top level of the included stylesheet, and so on recursively.
("Textual inclusion" here is a simplification: attributes and namespaces declared on the xsl:stylesheet element of the including module do not affect anything in the included module.)