The XSLT Extension Mechanism

The XSLT standard defines two kinds of extensions: extension elements and extension functions. The spec also defines fallback processing, a way for stylesheets to respond gracefully when extension elements and functions aren’t available. (Fallback processing also applies when we ask an XSLT 1.0 processor to process an XSLT 2.0 stylesheet.) We’ll talk about these items briefly, and then we’ll move on to some examples that illustrate the full range of extensions and fallback processing.

Keep in mind that the XSLT specs define how the extension mechanism should work; they do not define how it should be implemented. As we’ll see throughout this chapter, different XSLT processors implement extensions in different ways. For example, a Java-based XSLT processor might use a Java class to implement an extension function or extension element, while a .NET XSLT processor might use a .NET class to do the same thing. How those classes are specified varies from one processor to the next.

Get XSLT, 2nd Edition 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.