xsl:import-schema

Used to identify a schema containing definitions of types that are referred to in the stylesheet.

Category: declaration
Content: xs:schema?
Permitted parent elements: xsl:package ; xsl:stylesheet ; xsl:transform

Attributes

role?

ncname

New in XSLT 4.0. Specifies the role name for the imported schema, so that it is then used only in parts of the stylesheet within the scope of an [xsl:]schema-role attribute specifying this role name.

namespace?

uri

Specifies the target namespace of the schema to be imported. The attribute should be omitted when importing a schema with no target namespace.

schema-location?

uri

Specifies where the schema document can be found. This URI is passed through the URIResolver in the same way as the URIs used on xsl:include and xsl:import. The attribute can be omitted only if a schema for the required namespace has already been loaded in the Configuration, for example if it has already been imported from another stylesheet module.

Saxon availability

Available in XSLT 2.0 and later versions. Requires Saxon-EE. Available for all platforms.

Notes on the Saxon implementation

The xsl:import-schema declaration requires a schema-aware processor, so is only available in Saxon-EE. For further information see Using XML Schema (XSD).

The XSLT 4.0 attribute role is implemented since Saxon 13.

Links to W3C specifications

XSLT 3.0 Specification

XSLT 4.0 Specification

See also

xsl:include

xsl:import