Alternative elements

When the same formatting needs to be applied to the content of a number of different elements, it is not necessary to create a separate template for each one. Instead, a pattern can be used that specifies a list of alternatives. The '|' symbol is used for this purpose, and is placed between the element names:

match="X | Y | Z"

This technique could be used to format names and foreign terms in the same way:

match="name | foreign"


   <para>The <foreign>de facto</foreign> stylesheet
   language is <name>XSLT</name>.</para>

The de facto stylesheet language is XSLT

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.