Extension elements

A vendor may add some new instruction elements to those allowed within a template. As these would not be XSLT instructions, they must be defined using a different namespace. For example, a vendor may add an instruction that is able to reverse the characters in a text string, called Reverse:

   <reverse>abcdefghijklmnopqrstuvwxyz</reverse>


<xsl:template match="reverse">
  <P><acme:reverse select="."/></P>
</xsl:template>


   <P>zyxwvutsrqponmlkjihgfedcba</P>

Note that this mechanism only applies within templates. Top-level elements that are not recognized are simply ignored (see below).

Recognizing extension elements

An XSLT processor needs to know which elements are extension elements so that it will not treat these elements as simple ...

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.