Extending XSLT with Java

TrAX enables you to integrate XSLT code with Java programs. Most XSLT processors written in Java also let you go the other way, integrating Java code with XSLT stylesheets. The most common reason to do this is to provide access to operating system functionality that XSLT doesn't offer, such as querying a database, listing the files in a directory, or asking the user for more information with a dialog box. You can also use Java when you simply find it easier to implement some complex algorithm in imperative Java rather than in functional XSLT. For example, although you can do complicated string search and replace in XSLT, I guarantee you it will be about a thousand times easier in Java, especially with a good regular expression ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX 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.