xsl:item-type

Experimental XSLT 4.0 feature. Used to declare a name (or alias) for an item type.

Category: declaration
Content: none
Permitted parent elements: xsl:package ; xsl:stylesheet ; xsl:transform

Attributes

name

eqname

A QName used to identify the item type uniquely within the stylesheet package.

as?

item-type

The definition of the item type.

visibility?

"private" | "final"

The visibility of the item type. Saxon 11 only allows the value "private", which means the item type name is available only within the containing package.

Notes on the Saxon implementation

In the Saxon 11 implementation item type names must be unique within the stylesheet; import precedences for multiple declarations are not implemented, and item types are not visible in other stylesheet packages. The visibility attribute, if present, must have the value "private".

Saxon 11 requires the type name to be referenced in the form as="type(typename)", whereas the current XPath 4.0 proposal suggests allowing the simpler as="typename" (which requires type alias names to be distinct from the names of atomic and union types).

Details

The xsl:item-type element is always used at the top level of the stylesheet.

Examples

Declares and uses a named item type as a synonym for a record type:

<xsl:item-type name="complex" as="record(r as xs:double, i as xs:double)"/> <xsl:param name="location" select="0.00" as="type(complex)"/> <xsl:variable name="location-real-part" select="$location?r" as="xs:double"/> <xsl:variable name="location-imaginary-part" select="$location?i" as="xs:double"/>

Links to W3C specifications

XSLT 4.0 Specification