External XSLXSLT Processors


External XSL/XSLT Processors

XMLSPY’s built-in XSLT processor is designed for testing and debugging purposes only—it cannot be used outside of the XMLSPY editing environment in a server-production environment. The key difference between the XMLSPY’s XSLT processor and an external production XSLT processor, such as Apache Xalan or MSXML 4.0, is that a production XSLT processor is optimized to deliver maximum speed and concurrency. The XMLSPY processor is optimized for error reporting to facilitate XSLT-stylesheet development and debugging. XSLT stylesheets developed in XMLSPY can be run on any commercial-grade XSLT processor; however, you should always verify that XSLT stylesheet transformations work as intended on the targeted processor. This is necessary because, in practice, there are often slight differences between XSL technology implementations. This is the case for any standards-based technology. The following sections provide a partial listing of commonly used XSLT and XSL:FO processors.

MSXML 4.0

Microsoft Core XML Services (MSXML 4.0) was released March 13, 2002—it was formerly called the Microsoft XML Parser. The new release includes support for XML Schema and offers substantially faster parsing and XSLT transformation. MSXML 4.0 SP 1 is available for Windows 95/98/ME/NT4/2000/XP and can be downloaded for free from the Microsoft Developer Network at http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/ msdn-files/027/001/766/msdncompositedoc.xml . The MSXML engine is supported directly within XMLSPY—to specify MSXML as the default XSLT processor, choose Tools ’ Options ’ XSL and then select the Microsoft XML Parser option.

Apache Xalan

The Apache Group’s XML Project includes Apache Xalan, a powerful XSLT stylesheet processor available in Java and C++. Apache Xalan can be used from the command line or programmatically accessed inside of a Java or C++ application. Apache Xalan is available under an open source license and can, therefore, be freely embedded into an application. Source code is available at no cost.

To use Xalan Java as the XSLT processor in XMLSPY, follow these steps:

  1. Download the Xalan-Java v2.4 binary distribution from http://xml.apache.org/xalan-j/ .

  2. All Java applications need a Java Runtime Environment, so the CD-ROM that accompanies this book includes the Java 2 Platform, Standard Edition, v1.4 for Windows. Run the installer and accept the default settings.

  3. Decompress the Xalan-Java archive file and set the system path and Java classpath according to the instructions in the ReadMe file.

  4. Choose Tools ’ Options ’ XSL and then select External XSLT Transformation Program. Next, type the command line for invoking the processor: java org.apache.xalan.xslt.Process -IN %1 -XSL %3 -OUT %2.

To use Xalan C++ as the XSLT processor in XMLSPY, follow these steps:

  1. Download the Xalan C++ v1.4 binary distribution from http://xml.apache.org/xalan-c/ .

  2. Decompress the Xalan C++ archive file and set the system path according to the instructions in the ReadMe file.

  3. To set Xalan C++ as the default XSLT processor in XMLSPY, choose Tools ’ Options ’ XSL and then select External XSLT Transformation Program.

  4. From this same menu screen, type the command line for invoking the processor: testXSLT -IN %1 -XSL %3 -OUT %2.

Apache FOP

Apache FOP 0.20.3 is an open-source XSL:FO transformation engine that supports transformation to numerous output formats including PDF, PCL, PS, SVG, AWT, MIF, and TXT. The primary output target is PDF. Apache FOP is a Java application that requires a Java Runtime Environment 1.2.2 or newer. This can be downloaded from http://java.sun.com/j2se/downloads.html.

To perform an XML-to-PDF transformation within XMLSPY, follow these steps:

  1. Decompress the binary distribution of Apache FOP, which is included on the CD-ROM that accompanies this book.

  2. Choose Tools ’ Options ’ XSL and specify the path to the fop.bat file, which is located in the root directory of the Apache FOP binary distribution.

  3. To invoke an FO transformation, open an .fo file from the XMLSPY examples\tutorial directory (such as tiger.fo) and press the XSL:FO button located on the main toolbar (or press Ctrl+F10). Viewing a PDF file requires Adobe’s Acrobat Reader, which is also included on the CD.

For more information about Adobe Acrobat and the PDF file format, visit www.adobe.com/products/acrobat/.

RenderX XEP

RenderX XEP is a commercial-grade XSL:FO processor that can be invoked directly from within the XMLSPY editing environment by means of an XMLSPY plugin. RenderX’s XEP for XMLSPY can convert XSL:FO documents to a printable form through XMLSPY menus and toolbars. It can also apply XSL:FO stylesheets to XML documents using an integrated XSLT transformer. The PDF output can be immediately viewed in Adobe Acrobat Reader—for more information see www.renderx.com/~renderx/portal/xmlspy.html.




The XMLSPY Handbook
The Official XMLSPY Handbook
ISBN: 764549642
EAN: 2147483647
Year: 2001
Pages: 121
Authors: Larry Kim

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net