JDOM Example

This section applies to the Java platform only.

Saxon includes an adapter that allows the source tree to be a JDOM document.

To use this facility:

The sample application JDOMExample.java illustrates how a JDOM tree can be used with Saxon. It combines two scenarios: running XPath expressions directly against a JDOM tree, from the Java application; and invoking a transformation with the JDOM document supplied as the Source object.

The application is designed to take two arguments, the books.xml file in the samples/data directory, and the total.xsl file in the samples/styles directory. The application builds a JDOM tree, modifies it in situ to add extra attributes, and then references these attributes from the stylesheet.