# 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.x will run with either JDK 1.4 (properly the Java 2 platform, Standard Edition, v1.4) or JDK 1.5 (properly the Java 2 Platform, Standard Edition 5.0). Saxon also runs under JDK 1.6.

- Saxon implements APIs defined in JAXP 1.3 (JAXP is the Java API for XML Processing). JAXP 1.3 is a standard component in JDK 1.5, but if you are using JDK 1.4, it must be installed separately. For licensing reasons the JAXP package is not included in the Saxon distribution; instead you must download it separately from https://jaxp.dev.java.net/. This download includes two JAR files, `jaxp-api.jar` and `dom.jar`, which must be present on the classpath when running Saxon. Note that this means you cannot invoke Saxon using the `-jar` option, since this requires all files to be present in a single JAR archive, and ignores the CLASSPATH setting.

  Most XSLT and XQuery functionality in Saxon will work without installing JAXP 1.3. You need to install it if you are using DOM interfaces; if you are using the JAXP XPath API; or if you are using the JAXP schema validation API (applies to Saxon-SA only).

  The packaging of Saxon-SA changed in Saxon 8.9 to allow schema-aware processing to work on JDK 1.4 without the need to install JAXP 1.3 (unless you are actually using the JAXP API). This was achieved by separating the JAXP-dependent code into a separate JAR file, saxon9sa-jaxp.jar. As part of this change, some JAXP-related classes were moved to a different package.

  Saxon has options to work with source trees constructed using DOM, JDOM, XOM, or DOM4J:

  - To use Saxon with DOM, you need to add `saxon9-dom.jar` to your CLASSPATH. Saxon expects the DOM to support DOM Level-3 interfaces; if it does not do so, you should call the method `configuration.setDOMLevel(2)` on class `net.sf.saxon.Configuration. Saxon is validated using the DOM implementation packaged with the Sun JDK. It should work with other DOM implementations, but this can never be 100% guaranteed without testing.`

  - To use Saxon with JDOM, you need to add `jdom.jar` and `saxon9-jdom.jar` to your CLASSPATH. Saxon is validated with JDOM 1.0, which has been stable since September 2004; it should not be used with earlier JDOM releases.

  - To use Saxon with XOM, you need to add `xom-1.1.jar` and `saxon9-xom.jar` to your CLASSPATH. Saxon is tested with XOM 1.1, though it will probably still work with other recent releases.

  - To use Saxon with DOM4J, you need to add `dom4j-1.6.1.jar` and `saxon9-dom4j.jar` to your CLASSPATH. Saxon is tested with DOM4J 1.6.1.

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. By default, however, it uses the parser that comes with the Java platform (this is Crimson in the case of JDK 1.4, Xerces in the case of JDK 1.5). The parser must be SAX2-compliant. All the relevant JAR files must be installed on your Java CLASSPATH.

Earlier releases of Saxon included a version of the Ælfred XML parser. This version is no longer bundled with the Saxon distribution on Java platforms, because JDK 1.4 now includes an XML parser as standard. However the Saxon version of the Ælfred XML parser remains available as a separate download from the Saxon site at SourceForge. (Note that this version is not identical to the one that is included in GNU Classpath, which now forms part of the Saxon distribution on the .NET platform).

Saxon's DOM interface has been tested with the Crimson parser included as standard in Sun's JDK 1.4 platform and with the Xerces DOM implementation included in JDK 1.5. It has also been used successfully with other DOM implementations such as Oracle's, though it is not routinely tested in this environment.

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.

Next