Chapter 16

Extending XSLT

In This Chapter

bullet Discovering what extensions are

bullet Using extension elements

bullet Using extension functions

bullet Making sure your stylesheets are portable

Y ou know how it is. You get a shiny, new digital gizmo that does 1,001 things for you, but not two weeks go by before you discover the 1,002nd task you really need this gizmo to do, really want it to do, but lo and behold, it cannot do this task. This same Murphy’s Law of Gizmos applies to XSLT: The language does 1,001 kinds of transformations, but sooner or later, you encounter a need that XSLT doesn’t provide a solution for as part of its basic language. Perhaps you need to use a while loop inside your template rule. Or maybe you need to compare nodes from two different node sets and are throwing up your arms trying to do it with XSLT alone. Before you X out XSLT, read on.

As with any new technology, there are gaps in what comes “in the box” with XSLT. Fortunately, you don’t have to wait on future versions of the language to solve the problem. Instead, XSLT supports extensions that allow you to expand the scope ...

Get XSLT for Dummies now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.