Expand description
XSLT pattern matching (§33, §85 Phase 8).
XSLT patterns are a subset of XPath 1.0 used in match attributes of
<xsl:template>, <xsl:key>, <xsl:strip-space>, <xsl:preserve-space>.
Patterns can include:
- Location paths (relative and absolute)
- Union patterns (pattern1 | pattern2)
- Node tests: *, node(), text(), comment(), processing-instruction()
- Attribute axis (@attr)
- Namespace prefix tests (ns:*, ns:name)
- Predicates (limited)
- The id() and key() functions
§UPSTREAM-PARITY
Implements XSLT 1.0 §5 “Patterns” with match semantics matching libxslt 1.1.39.
Pattern matching uses the XPath 1.0 AST from src/xml/xpath for parsing, then
applies XSLT-specific matching rules.
§Courts
XSLT-PATTERNS-*
Structs§
- _xslt
Pattern - Opaque pattern structure.
- _xslt
Pattern Step - Opaque pattern step structure.
Constants§
- XSLT_
PAT_ NO_ PRIORITY - Sentinel for “no explicit priority” (upstream XSLT_PAT_NO_PRIORITY).
Functions§
- get_
pattern_ matched_ names - Get the names matched by a simple name-test pattern.
- is_
simple_ name_ pattern - Check if a pattern string matches a single step (simple name test).
- is_
union_ pattern - Check if a pattern is a union pattern (contains
|). - xslt
Compile ⚠Pattern - Compile an XSLT pattern string into a compiled pattern.
- xslt
Default ⚠Priority - Compute default priority for a match pattern.
- xslt
Free ⚠Pattern - Free a compiled pattern.
- xslt
Test ⚠Match Pattern - Test whether a node matches a compiled pattern tree.
- xslt
Test ⚠Pattern - Test whether a node matches a compiled pattern.