Simple location contexts

Typically, an element that has a significant context is identified simply by its location within the document structure. The name of the parent element, or some other ancestor element, determines the context.

Specific parent

In many cases, it is sufficient to specify what the parent element must be for the template to be applicable. In the following example, an X element is only to be selected when it is directly within a P element:

match="P/X"

The '/' symbol does not itself indicate that 'X' is the child of 'P'. This symbol is simply used to separate steps in a location path. When a particular step consists of only ...

Get XSL companion, The 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.