Formally Defining Match Patterns

You also can find the definition of match patterns in the W3C XSLT Recommendation. Match patterns are defined in terms of XPath expressions this way:

“The syntax for patterns is a subset of the syntax for [XPath] expressions. In particular, location paths that meet certain restrictions can be used as patterns. An expression that is also a pattern always evaluates to an object of type node-set. A node matches a pattern if the node is a member of the result of evaluating the pattern as an expression with respect to some possible context; the possible contexts are those whose context node is the node being matched or one of its ancestors.”

The most important sentence in the preceding paragraph is the last one. The ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.