Used to declare the initial context item for a template: whether the template requires a context item, and if so, what its expected type is.

Content: none
Permitted parent elements: xsl:template




The required type of the context item; the default is item().


"required" | "optional" | "absent"

Specifies whether a template requires a context item; the default is optional.

Notes on the Saxon implementation

Implemented since Saxon 9.7. The initial implementation is functionally complete, but the context item information is not used for optimization or for static type checking. The information is used for assessing streamability.

Links to W3C specifications

XSLT 3.0 Specification