Advanced context

Context need not depend only on the location of the target element in the document hierarchy. The content of the element itself may need to influence the formatting to be applied. For example, an automatically generated prefix of either 'Warning:' or 'Warnings:' may be needed, depending on whether the Warning element contains a single paragraph or a list of warning items.

Specific children

It is possible to select an element that is the parent of another specific element, by placing the name of the sub-element within square brackets:

match="X[C]"

The square brackets actually enclose a 'predicate filter'. A filter consists of ...

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.