Prerequisites
The following software must be installed separately, it is not included with the Saxon download.
-
To run Saxon you need at least a Java VM, and preferably a Java development environment. Saxon 9.7 requires at least Java SE 6 (also known as JDK 1.6). It also runs under later Java versions.
-
Saxon has options to work with source trees constructed using DOM, JDOM, JDOM2, XOM, DOM4J, or AXIOM:
-
To use Saxon with DOM, you do not need any extra code on your classpath. The DOM implementation should support DOM Level-3 interfaces, and the DOM must be built with namespace processing enabled. Saxon retains some legacy code designed to handle level-2 DOM implementations, which can be activated by calling the method
configuration.setDOMLevel(2)
on classnet.sf.saxon.Configuration
, but this code is now untested and unsupported. Saxon is tested with both the DOM implementation provided by the Apache Xerces parser, and the DOM that is packaged with the Oracle JDK. It should work with other DOM implementations, but this can never be 100% guaranteed without testing. Many DOM implementations, especially non-productized implementations, deviate in minor but significant ways from the specifications. -
For the other object models, JDOM, JDOM2, XOM, DOM4J, and AXIOM, the supporting Saxon adapter code is integrated into the JAR files for Saxon-PE and Saxon-EE, but is available only as source code for Saxon-HE. To exploit this code with the open source Home Edition, you will need to compile the source code from the relevant subpackage of
net.sf.saxon.option
. Whichever edition you are using, the external object model is available for use only if you register it using the methodregisterExternalObjectModel
on theConfiguration
object, or via the configuration file. Saxon no longer searches the classpath to see which object models are present, because classpath searches are expensive and make the application over-sensitive to details of the way it is run.
-
By default Saxon uses an XML parser that supports the SAX2 interface. Saxon has been tested successfully in the past with a wide variety of such parsers including Ælfred, Xerces, Lark, SUN Project X, Crimson, Piccolo, Oracle XML, xerces, xml4j, and xp. The recommended parser is the Apache version of Xerces (we have found this to be more reliable than the version bundled in the JDK). By default, however, Saxon uses the parser that comes with the Java platform. The parser must be SAX2-compliant. All the relevant JAR files must be installed on your Java CLASSPATH.
Saxon will also work with a StAX parser. Generally speaking, StAX parsers are currently less mature than SAX parsers, and any performance advantage is likely to be very minor. However, the support for StAX provides the ability to supply input via a customized pull pipeline. Saxon is tested with Woodstox 3.0.0. Saxon's schema validation is available only with a SAX2 parser.