xsl:match

Experimental: proposed new XSLT 4.0 instruction. 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.

Saxon availability

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.

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, or 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.

For more information, see The xsl:match instruction.

Links to W3C specifications

XSLT 4.0 Specification