XSLT Tools

This section describes several commonly used XSLT tools. XML Spy Suite, mentioned in the preceding section, also includes an XSLT Designer.

Saxon and Instant Saxon

Saxon is a Java-based XSLT processor. Instant Saxon is a Windows-specific executable version that can be run on Windows 95, 98, Me, and 2000.

Note

If you want to run Instant Saxon on Windows XP, you will need to download the Microsoft Java Virtual Machine, the JVM, separately from the Microsoft Web site. Visit www.microsoft.com/java/default.htm for current information.



The various versions of Saxon—stable and developer versions—and Instant Saxon are described at http://saxon.sourceforge.net.

The full Saxon download contains API documentation and examples, as well as source code. Instant Saxon contains an executable with a single HTML Web page in a Zip file.

Caution

Older versions of the Microsoft JVM can cause Saxon to output blank documents. This problem is now not common, but you might want to check that you have the latest version of the JVM using the Windows Update facility in Internet Explorer.



To install Instant Saxon on a Windows platform, assuming that you have WinZip (www.winzip.com) or a similar utility installed, simply double-click the Zip file and select an appropriately named directory (perhaps C:Instant Saxon) to install Saxon into. To check whether Instant Saxon has installed correctly, open a command prompt, change to the installation directory you chose, and type Saxon . The command prompt window should show a message indicating the version of Instant Saxon that you installed and a series of messages explaining the basic syntax for using Instant Saxon. If you see that message, the installation has been successful.

Likely, you will want to store XML and XSLT files in the Instant Saxon directory or add the appropriate directory to the path environment variable.

MSXML

Microsoft started development of an “XSL” processor at a time before XSL (in W3C terminology) split into XSLT and XSL Formatting Objects (XSL-FO).

Note

A lot of practical advice about installing and using the various versions of the MSXML parser is available at www.netcrucible.com/.



MSXML version 3 (and above) includes an XML processor and an XSLT processor (among other things). If you have Microsoft Internet Explorer version 5.5 or earlier, you will not have MSXML version 3 installed by default. Earlier versions of MSXML support a Microsoft-specific, non-standard approximation of XSLT. Versions of MSXML earlier than 3 should be avoided to ensure future compatibility with W3C standards.

To download the MSXML parser and XSLT processor, visit www.microsoft.com/XML/.

Note

Microsoft has begun to refer to the MSXML software as Microsoft XML Core Services. If you can’t find any reference to MSXML 3 or 4, search for the newer term.



Chris Bayes has written an MSXML Sniffer utility that can detect whether you have MSXML version 3 or above installed and whether it is in replace mode (which is what you want for XSLT processing). Go to www.bayes.co.uk/xml/index.xml?/xml/main.xml and look for the link to MSXML Sniffer (left panel of the Web page, at the time of writing).

Note

Internet Explorer version 6 has MSXML version 3 already installed.



Xalan

Xalan is a Java-based XSLT processor under ongoing development by the Apache Foundation (http://xml.apache.org). Details of the Java version of the Xalan XSLT processor can be found at http://xml.apache.org/xalan-j/index.html. At the time of this writing, Xalan-J, the Java version of Xalan, is at version 2.4.

Note

Xalan version 1 is no longer supported and has been removed from the xml.apache.org Web site. If your computer uses only early versions of Java, you might be able to download the necessary files to run Xalan 1 by searching in Google.com.



Xalan can be used from the command line, can be used in an applet or servlet, or can be incorporated in a full application.

By default, Xalan-J uses the Xerces XML parser, also from the Apache Foundation. Typically the Xalan download includes the appropriate version of the Xerces parser. If you want to run Xalan with another XML processor, configuration instructions are available from the Apache Web site.

To run the currently supported versions of Xalan-J and Xerces, you need either a Java Runtime or a Java Software Developer’s Kit installed on your computer. Version 1.2 or later is required. If you do not already have a suitable Java Runtime or JSDK installed, you can download one from http://java.sun.com. Further information on the latest versions is also available there.

Be sure to add the Xalan and Xerces jar files to the classpath on your computer.

Caution

If you use multiple Java applications that make use of the Xerces XML parser, it is very easy to have multiple versions of Xerces on your computer at one time. If more than one version has been added to the classpath, you might find that the wrong version is accessed first and that unexpected and puzzling errors occur.



Tip

If you plan to use multiple Java-based applications, create a simple batch file that you run when you open the command window. The batch file can set the path and classpath to settings that are specific to the Java application that you want to run. This avoids potential clashes between different versions of Java software.



..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset