Extension functions

A vendor may add more functions to the expression language. As these would not be XSLT or XPath functions, they must be defined using a different namespace. For example, a vendor may add a function that is able to reverse the characters in a text string, called reverse():

   <reverse>abcdefghijklmnopqrstuvwxyz</reverse>


<xsl:template match="reverse">
  <P><xsl:value-of select="acme:reverse(.)"/></P>
</xsl:template>


   <P>zyxwvutsrqponmlkjihgfedcba</P>

New functions must have a prefix, or they will be assumed to be extensions to those defined by XPath or XSLT (in a later version of these standards).

While an XSLT processor that does not understand the new function must raise an error if an attempt is made to use it, the processor ...

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.