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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access