Patterns

A pattern is a form of expression that is used to establish if an object of interest matches some given criteria (rather than to locate and select the object). Location paths, of a certain limited kind, are used in patterns to decide if the currently selected element occurs in a specific context. Instead of the expression 'chapter/para' being interpreted as a request to find paragraphs in chapters, it is interpreted as a question about the identity and location of a particular element instance. Is the current element a Paragraph element, and is it also the child of a Chapter element? The answer can only be yes or no ('true' or 'false').

XSLT makes significant use of XPath patterns (indeed, the formal definition of a pattern can be found ...

Get XML Companion, The, Third Edition 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.