Trademark Logo Xalan XSL Transformer User's Guide
Download/Build & Dependencies
Apache Foundation Xalan Project Xerces Project Web Consortium Oasis Open

Download/Build & Dependencies


Downloading the latest release

You can download the pre-built binary distributions from one of the mirror sites at xalan-j distribution directory.

Xalan-J has two processors, an interpretive one "Xalan Interpretive", and a compiled one "Xalan Compiled (XSLTC)". The Xalan-J binary distribution contain xml-apis.jar and xercesImpl.jar from Xerces-Java 2.12.2.

The Xalan-J binary distribution, or xalan-j_2_7_3-bin.tar.gz, contains the Xalan Interpretive processor, the Xalan Compiled processor (XSLTC) and the runtime support packages in a single jar, called xalan.jar.

We provide two distributions: a binary distribution, and a source distribution. You can also download a source distribution from one of the same mirror sites at xalan-j distribution directory. The difference is that a binary distribution contains -bin in its name, whereas a source distribution contain -src in its name.

To use Xalan-Java, you need the following which are available from either a binary or source distribution:

If you have downloaded a binary distribution, you already have a build (you have the jars). This is also true for a source distribution, however if you downloaded a source distribution, you have the option to use Ant to build Xalan-Java, including xalan.jar, xsltc.jar, serializer.jar and other things, see Using Ant for more details.


Downloading what else you might need

To use Xalan-Java, you need the following:

You can get the JDK or JRE from IBM Java SDK downloads or Oracle Java downloads.

If you plan to run XSLT extensions through extension functions or elements, and you want to implement that support in languages other than Java, then you will need an implementation of the Bean Scripting Framework (BSF). An open source implementation is available for download from Apache. See the Apache Jakarta BSF project. If you plan to run XSLT extensions implemented in scripting languages, you will need bsf.jar and one or more additional files as indicated in extensions language requirements.


Where do I get Xerces-Java?

The Xalan-Java Version 2.7.3 has been tested with Xerces-Java 2.12.2.

Important: You may experience unpredictable anomalies if your Xalan-Java and Xerces-Java builds are not in synch. If you download an update to Xalan-Java, check the release notes to determine which version of Xerces-Java you should use.

note You can use Xalan-Java with other XML parsers that implement the Java API for XML Processing (JAXP) 1.3. See Plugging in the Transformer and XML parser.

The Xalan-Java download includes xercesImpl.jar from Xerces-Java 2.12.2. In conjunction with xml-apis.jar, this is all you need to run Xalan-Java with the Xerces-Java XML parser. You can, however, download the complete Xerces-Java binary or source distribution from the xerces-j distribution directory. If you cannot find Xerces-Java 2.12.2 at that location, have a look at the Apache archive location for Xerces Java.

note If you plan to use a different XML parser, see Plugging in a Transformer and XML parser.


How do I view Xalan code in a browser?

Xalan's codebase files may be viewed on browser at

The Xalan git repositories xalan-java (branches 'master', xalan-j_xslt3.0) and xalan-test (branch 'master') are the ones with the latest development code.

The details of XSL 3.0 language features supported on xalan-java dev repos's branch xalan-j_xslt3.0 are available at XalanJ XSLT 3.0 implementation status.


How do I download the latest development code to build myself?

If you have downloaded a source distribution, or obtained source code using git, this section may be of interest to you.

If you wish to download Xalan and build it yourself, perhaps because you want to apply a patch and test it, you will need a git client and anonymous access to the repository. Don't worry, everyone has anonymous access. You can find pre-built binaries of git clients for different operating systems here:

You may use the Xalan-J build scripts, build.bat or (depending on your operating system), and use ant and the buildfile build.xml to build Xalan-J. See the section Using ant for more information.

Few of the useful Xalan-J build targets are : jar, xsltc.jar, serializer.jar. If you want to test the jars you just built in the directory xalan-java/build, change to directory xalan-test and issue following commands:

  build jar
  build smoketest
The first target, jar builds the test harness and only needs to be done once after the test repository is checked out. The second target, smoketest, runs the Xalan-J intepretive smoketest. Running the build smoketest or other targets in the test directory automatically looks for the jars in the directory ../java/build and that is why it is easiest to download the projects into suggested sibling directories with the given names.

Towards the end of the console output you will see two CONGRATULATIONS! messages if all goes well. The end of the console output should look like this:

     [echo]  [minitest] CONGRATULATIONS! The Minitest passed!
     [echo]  [minitest] See details in smoketest/Minitest.xml


     [echo]  [minitest] CONGRATULATIONS! The Smoketest passed!
     [echo]  [minitest] Details are in smoketest/results-conf.xml, smoketest/results-api.xml, smoketest/extensions/results-extensions.xml


Total time: 2 minutes 4 seconds
build completed!

Don't be fooled by the BUILD SUCCESSFUL messages, look for the two CONGRATULATIONS! messages. If you run the smoketest for XSLTC with build smoketest.xsltc you wil only get one CONGRATULATIONS! message if all goes well.


Using Ant To Build

If you have downloaded a source distribution, or obtained source code using subversion, this section may be of interest to you.

Apache Ant is a flexible, powerful, and easy-to-use Java build tool that we include with the Xalan-Java distribution. The Ant JAR file is in the tools directory, and the cross-platform XML build file (build.xml) is in the root directory along with a Windows32 batch file (build.bat) and a UNIX shell file ( The build file defines the "targets" that you can use Ant to build. The batch and shell files set up the classpath and launch Ant with the target (and any other arguments) you provide.

Instructions for using Ant

  1. Set the JAVA_HOME environment variable to the JDK root directory.

    JDK 1.3.1 or higher is required to build Xalan-Java. You must put tools.jar from the JDK bin directory on the classpath.

  2. Depending on your environment, run the batch file (build.bat) or shell file ( from the Xalan-Java root directory, optionally with arguments (see the table of targets below).

    The batch/shell file adds several JAR files to the classpath and launches Ant with any arguments you provide. If you provide no target, Ant compiles the source files and rebuilds xalan.jar (the "jar" target).

The Xalan-Java source code tree is in the src directory.

If you are using Ant, the target is jar (the default).

You can also set up your classpath manually (see build.bat or for the details), and then run Ant as follows:

java target

where target is nothing (for the default target) or one of the following.

Ant Target What Ant does
compile compiles Xalan-Java in build/classes.
jar (the default) creates xalan.jar and serializer.jar in the build directory
serializer.jar creates serializer.jar in the build directory
xsltc.jar creates xsltc.jar in the build directory
samples compiles and jars the sample apps in build/xalansamples.jar
servlet compiles and jars the sample servlet in build/xalanservlet.jar
docs creates the HTML User's Guide in build/docs
javadocs generates the API documentation in ./build/docs/apidocs
fulldist generates a complete distribution tree with zip and tar.gz distribution files in build
clean purges the build and distribution

If you build a target that depends on other targets, Ant creates those other targets in the correct order.

Building without Ant

If you want to do the build without Ant, keep the following in mind:


Rebuilding a sample application

If you modify a sample and want to recompile it, you can run the Java compiler in the directory containing the example. Be sure xalan.jar, serializer.jar, xml-apis.jar, and xercesImpl.jar are on the classpath.

To recompile and run the class files in the servlet subdirectory, the javax.servlet and javax.servlet.http packages must also be on the classpath. These packages are available via the servlet.jar file found in Apache Tomcat ( see The Jakarta Site - Apache Tomcat ).

After recompiling a sample, you can use the jar utility to place your new .class files in xalansamples.jar.

You can use Ant with the samples target to recompile the samples and place the unpackaged class files in xalansamples.jar. For more information, see Using Ant.

note To rebuild (and to run) the sample servlet, the javax.servlet and javax.servlet.http packages must be on your classpath.


Where do I download previous releases?

To access previous releases, see the xalan-j archive directory.