Getting Started with Xalan-C++
- Downloading what you need
- Setting up the path/library path
- Trying out the samples
- Performing your own transformations from the command line
- Setting up your own XSLT applications
This section is being rewritten. See: new getting started
Downloading what you need
For Xalan-C++ Version 1.11, we are distributing the following:
- AIX 5.1 32-bit and 64-bit xlC_r builds
- HP-UX 11 32-bit and 64-bit aCC builds
- Red Hat Linux 7.2 32-bit and 64-bit Intel C++ builds
- Solaris 2.7 32-bit and 64-bit Forte C++ builds
- SuSE Linux 8.1 for IA-32 gcc 3.2.2 build
- Windows 32-bit and 64-bit Visual C++ builds
As with previous releases, the documentation build containing this User's Guide and API documentation will be provided in a separate distribution.
Please contact us at Xalan Development Mailing List if you would like to help provide builds for other platforms.
If you do not already have it, you must also download the Xerces-C++ version 3.1.1 build as indicated below.
|The Xalan distribution files are in Xalan-C downloads. The Xerces distribution files are in Xerces-C downloads. Xalan documentation is provided in a separate package from the binary distribution files. For Windows, documentation is packaged with the file name Xalan-C_1_11_0-docs.zip. For UNIX, documentation is packaged with the file name of Xalan-C_1_11_0-docs.tar.gz.|
|Xalan distribution files||Xerces distribution files||Platform|
|Xalan-C_1_11_0-aix_510-xlc_60_050623.tar.gz||xerces-c-3.1.1-aix_510-xlc_60_050623.tar.gz||AIX 5.1 (32-bit)|
|Xalan-C_1_11_0-aix_510_64-xlc_60_050623.tar.gz||xerces-c-3.1.1-aix_510_64-xlc_60_050623.tar.gz||AIX 5.1 (64 bit)|
|HP-UX 11.0 (32 bit)|
|HP-UX 11.0 (64 bit)|
|Xalan-C_1_11_0-redhat_72-icc_71.tar.gz||xerces-c-3.1.1-redhat_72-icc_71.tar.gz||Redhat Linux 7.2 (32-bit)|
|Xalan-C_1_11_0-redhat_72_64-ecc_71.tar.gz||xerces-c-3.1.1-redhat_72_64-ecc_71.tar.gz||Redhat Linux 7.2 (64-bit)|
|Solaris 2.7 (32-bit)|
|Solaris 2.7 (64-bit)|
|Xalan-C_1_11_0-suse_81-gcc_32.tar.gz||xerces-c-3.1.1-suse_81-gcc_32.tar.gz||SuSE Linux 8.1 (32-bit)|
||Windows 2003 Server (64-bit)
The compiler version used for each platform is listed in the table below.
|Platform - Operating System||Compilers|
|AIX 5.1||IBM C and C++ for AIX 6.00|
|HP/UX 11.0||aCC A.03.52|
|Red Hat Linux 7.2||Intel C++ Compiler, version 7.1|
|Solaris 2.7||Sun Workshop 6 update 2|
|SuSE Linux 8.1||gcc Compiler, version 3.2.2|
|Windows NT, 2000, and XP||Microsoft Visual C++ with SP5 (for 32-bit)
Intel C++ Compiler, version 7.1 (for 64-bit)
|Use GNU tar to untar the Solaris distribution file; see A tar checksum error on Solaris.|
If you want to take advantage of the support for number formatting, sorting, and encoding the ICU provides, you should also download and install the International Components for Unicode (ICU); see Using the ICU,
|To access previous releases of Xalan-C++, visit the Xalan-C archive directory.|
Setting up the path/library path
To use the Windows binary distribution, you must place the Xalan executables and the Xalan and Xerces libraries on the path:
- Put Xalan-C_1_11_0-<my_Windows_distribution>\bin and xerces-c-3.1.1-<my_Windows_distribution>\bin on the path.
The Visual C++ Xalan project included with the Windows release knows the relative paths to the Xalan headers and libraries, but it does not know where you have unzipped the Xerces distribution. If you plan to use Visual C++ to build Xalan applications or rebuild Xalan, you must also provide Visual C++ with access to the Xerces headers and libraries.
Use the Visual C++ Tools menu to open the Options dialog box, go to the Directories tab, and do the following:
- Add the path to xerces-c-3.1.1-<my_Windows_distribution>\include to the list of directories of Include files.
- Add the path to xerces-c-3.1.1-<my_Windows_distribution>\lib to the list of directories of Library files.
To use one of the UNIX binary distributions, you must place the Xalan-C++ executable on the path, and the Xalan-C++ and Xerces-C++ libraries on the library path.
For the Xalan-C++ AIX distributions:
- Put Xalan-C_1_11_0-<my_AIX_distribution>/bin on the path (PATH).
- Put Xalan-C_1_11_0-<my_AIX_distribution>/lib and xerces-c-3.1.1-<my_AIX_distribution>/lib on the library path (LIBPATH), or copy the shared libraries to /usr/lib.
For the Xalan-C++ HP-UX 11 distributions:
- Put Xalan-C_1_11_0-<my_HPUX_distribution>/bin on the path (PATH).
- Put Xalan-C_1_11_0-<my_HPUX_distribution>/lib and xerces-c-3.1.1-<my_HPUX_distribution>/lib on the library path SHLIB_PATH), or copy the shared libraries to /usr/lib.
For the Xalan-C++ Solaris distributions:
- Put Xalan-C_1_11_0-<my_Solaris_distribution>/bin on the path (PATH).
- Put Xalan-C_1_11_0-<my_Solaris_distribution>/lib and xerces-c-3.1.1-<my_Solaris_distribution>/lib on the library path (LD_LIBRARY_PATH), or copy the shared libraries to /usr/lib.
For the Xalan-C++ RedHat and SuSE Linux distributions:
- Put Xalan-C_1_11_0-<my_Linux_distribution>/bin on the path (PATH).
- Put Xalan-C_1_11_0-<my_Linux_distribution>/lib and xerces-c-3.1.1-<my_Linux_distribution>/lib on the library path (LD_LIBRARY_PATH), or copy the shared libraries to /usr/lib.
Trying out the samples
The Xalan-C++ distribution includes a number of basic sample applications. We have precompiled these samples for you so they are ready to run, and you can review the source files to see just how they work.
To run the samples, do the following:
- Set up your path (see above). In the Windows32 distribution, the sample executables are in Xalan-C_1_11_0-<my_Windows_distribution>\bin. In the UNIX distributions, the executables are in Xalan-C_1_11_0-<my_UNIX_distribution>/bin.
- Go to the samples subdirectory containing the sample.
- Run the sample from the command line (in Windows, use the DOS shell).
- Examine the application source files.
For example, go to the SimpleTransform subdirectory and issue the following command:
SimpleTransform uses the foo.xsl stylesheet to transform foo.xml, and writes the transformation result to foo.out. To see how the example works, examine the source files: foo.xml, foo.xsl, foo.out, and SimpleTransform.cpp.
For more information about the samples, see Xalan-C++ Samples.
Performing your own transformations from the command line
The Xalan executable lets you perform transformations from the command line. The command line for most standard transformations is as follows:
where xmlSource is the XML source file name, stylesheet is the XSL stylesheet file name, and outputfile is the output file name.
If you want the output to be displayed on the screen, simply omit the -o flag and outputfile .
You can use this utility to try out XSL stylesheets you have written, to make sure they do what you expect with the XML source files they are designed to transform. The utility provides useful messages if the source file or stylesheet is not well formed. If you include a DOCTYPE statement or Schema hint in your XML source files and include the -v flag on the command line, the utility will also let you know whether the XML document is valid (conforms to that DOCTYPE or Schema). For more information, see Command-Line Utility.
Setting up your own XSLT applications
You can start by using your own XML source files and XSL stylesheets with the sample applications, which illustrate a number of usage patterns. For more information on setting up applications, see Basic Usage Patterns.