Experimental: proposed new XSLT 4.0 declaration. Used to declare a name (or alias) for an item type.
A QName used to identify the item type uniquely within the stylesheet package.
The definition of the item type.
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.
Available in the XSLT 4.0 proposal. Requires Saxon-PE or Saxon-EE. Implemented experimentally since Saxon 11. Available for all platforms.
Notes on the Saxon implementation
Available from Saxon 11; requires syntax extensions to be enabled. Also available in
earlier releases under the synonym
In the current 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
if present, must have the value
Saxon 11 requires the type name to be referenced in the form
whereas the current XPath 4.0 proposal suggests allowing the simpler
(which requires type alias names to be distinct from the names of atomic and union types).
xsl:item-type element is always used at the top level of the
Declare and use 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"/>