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).
Your choice of which binary distribution to download depends on which
of the processors you want to use.
There are 2 binary distributions available; you only need to choose one of them.
Both binary distributions contain xml-apis.jar and xercesImpl.jar from Xerces-Java 2.9.0.
xalan-j_2_7_1-bin.zip or
xalan-j_2_7_1-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.
The reason to use this distribution would be that you don't know
which processor you are going to use, or might be using both.
xalan-j_2_7_1-bin-2jars.zip or
xalan-j_2_7_1-bin-2jars.tar.gz
contains the Xalan Interpretive processor in xalan.jar, and the Xalan Compiled
processor (XSLTC) and the runtime support packages in xsltc.jar.
The reason to using this distribution is that you want more control.
If you are using just XSLTC you can put xsltc.jar on the classpath
and not xalan.jar. If you are using just the interpretive processor
you can put xalan xalan.jar on the classpath and not xsltc.jar. Of course
you can put both xalan.jar and xsltc.jar from this distribution
on your classpath if you want to use both.
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:
xml-apis.jar JAXP APIsxercesImpl.jar (or another XML Parser)xalan.jarxsltc.jar the XSLTC processor, if you choose a 2jars distributionserializer.jar which are the serializer classes of
Xalan-Java
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.
To use Xalan-Java, you need the following:
You can get the JDK or JRE from IBM developerWorks or java.sun.com.
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.
The Xalan-Java Version 2.7.1 has been tested with Xerces-Java 2.9.0.
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.
The Xalan-Java download includes xercesImpl.jar from Xerces-Java 2.9.0. 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.9.0 at that location, have a look at the
Apache archive location for
Xerces Java.
If you wish to view some of Xalan's files in a browser without downloading the whole project you can view it at http://svn.apache.org/viewvc/xalan/ or at http://svn.apache.org/repos/asf/xalan/. The link with "viewvc" in it is slightly prettier.
The java/trunk and test/trunk subdirectories are the ones with the latest development code.
If you have downloaded a source distribution, or obtained source code using subversion, 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 subversion client and anonymous access to the repository. Don't worry, everyone has anonymous access. You can find pre-built binaries of subversion clients for different operating systems here: http://subversion.tigris.org/project_packages.html#binary-packages. See http://www.apache.org/dev/version-control.html for more information on Apache and subversion.
Once the subverion client is installed on your local machine you can use the command line client program svn to get the latest Xalan-J using a command line something like this:
svn checkout http://svn.apache.org/repos/asf/xalan/java/trunk java
Similarly for the test harness, you can download the latest test harness with a Subversion command something like this:
svn checkout http://svn.apache.org/repos/asf/xalan/test/trunk test
Those two commands will put a copy of the latest parts in the local directories java and test, which are sibling directories. If you want to test your build with the test harness provided with Xalan then it is easiest if you keep the local directory names as suggested. With your paths set up to compile Java code, go into the local java directory and issue these two commands:
build clean build
The build.bat batch file, or build.sh shell script (depending on your operating system use ant and the buildfile build.xml. See the section Using ant for more information.
Other useful targets may be xsltc.jar or serializer.jar.
If you want to test the jars you just built in the directory java/build, change to
directory test and issue this command:
build jar build smoketest
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:
. . . minitest-pass: [echo] [minitest] CONGRATULATIONS! The Minitest passed! [echo] [minitest] See details in smoketest/Minitest.xml smoketest-notpass: smoketest-pass: [echo] [minitest] CONGRATULATIONS! The Smoketest passed! [echo] [minitest] Details are in smoketest/results-conf.xml, smoketest/results-api.xml, smoketest/extensions/results-extensions.xml smoketest: BUILD SUCCESSFUL 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.
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 (build.sh). 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
tools.jar from the JDK
bin directory on the classpath.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 build.sh for the details), and
then run Ant as follows:
java org.apache.tools.ant.Main target
where target is nothing (for the default target) or one of the following.
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:
xercesImpl.jar, and xml-apis.jar.jar utility to store the resulting .class files in xalan.jarIf 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.
To access previous releases, see the xalan-j archive directory.