xsl:match

Matches selected items against an XSLT pattern.

Category: instruction
Content: ( xsl:fallback* )
Permitted parent elements: any XSLT element whose content model is sequence-constructor; any literal result element

Attributes

select?

expression

Selects the values to be matched against the pattern. If the attribute is absent, it defaults to select=".". The xsl:match instruction returns true if every selected item in the value of this expression matches the given pattern; otherwise it returns false. (Note: this means that if the value of the select expression is an empty sequence, the instruction will return true.)

pattern

pattern

The XSLT match pattern used to test items in the selected sequence.

Notes on the Saxon implementation

Available in Saxon 11; requires XSLT syntax extensions to be enabled.

Details

The result of the instruction is an xs:boolean value: true if every selected item matches the supplied pattern, otherwise false.

The instruction will normally be used where an atomic value is expected, for example as the body of a stylesheet function, the body of an xsl:variable with as="xs:boolean".

Any xsl:fallback children are relevant only if the instruction is executed in forwards-compatibility mode by a processor that doesn't recognize XSLT 4.0 instructions.

Links to W3C specifications

XSLT 4.0 Specification