0% found this document useful (0 votes)
152 views

How To Run XSLT 2.0 Stylesheets With Eclipse?

This document provides instructions for configuring Eclipse or running from the command line to use the Saxon XSLT 2.0 parser. For Eclipse, it describes downloading the Saxon jar files, adding them in the Eclipse preferences under XML > XSL Java Processors, and setting Saxon as the default processor. For the command line, it explains using the Saxon jar file with Java commands to transform an XML file with an XSLT stylesheet and outputting the results.

Uploaded by

vmsrinivas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

How To Run XSLT 2.0 Stylesheets With Eclipse?

This document provides instructions for configuring Eclipse or running from the command line to use the Saxon XSLT 2.0 parser. For Eclipse, it describes downloading the Saxon jar files, adding them in the Eclipse preferences under XML > XSL Java Processors, and setting Saxon as the default processor. For the command line, it explains using the Saxon jar file with Java commands to transform an XML file with an XSLT stylesheet and outputting the results.

Uploaded by

vmsrinivas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

How

to run XSLT 2.0 stylesheets with Eclipse?


For this we will need a special parser that supports XSLT 2.0 feature, we will use Saxon. You
can read more about it at http://saxon.sourceforge.net/
Saxon parser jar files have been provided as a zipped archive link below the lab sheet link-
make sure you download the zipped archive. Unzip the archive and save the jar files at a
safe place, you will need them later on.
You have two choices here- you can either use Eclipse or use command line.
Let us look at both-
Choice # 1: Configure Eclipse to use Saxon XSLT 2.0 parser
1. Launch Eclipse
2. Open Preferences window (available via menu: Windows Preferences in
windows and Eclipse Preferences menu in mac)
3. Click on arrow next to XML branch (at the very end)
4. Click on XSL Java Processors (as shown below)


1
5. Click on Java Processors and then click on Add button in the right hand side window
pane- a separate window will open as shown below

6. Change the processor in Processor Type drop down box to Saxon (XSLT 2.0)
7. Click on Add External JARs button
8. Add the Saxon jar files (you were asked to save them at an earlier stage of this
tutorial). Click OK
9. Set Saxon as default XSLT processor by choosing it as shown below

10. Click OK, you are now ready to go




Rest of the steps are same as outlined in tute/lab sheet 7 (ie how to apply a XSLT stylesheet
to an XML document)

2
How to run XSLT 2.0 stylesheets witout Eclipse?

Run Saxon at command line/Terminal (for those who do not wish to use Eclipse)

You must have Java installed on your machine!

1. You will need Saxon parser; it has been supplied as a part of the zipped file.

2. Unzip the archive, the file you need is saxon9he.jar--- place this jar file in the
same directory as input XML file and XSLT file.

Saxon can perform both XSLT 1.0 and 2.0 transformations!

XSLT 1.0/2.0 transformations:


java jar saxon9he.jar ---o :output.html input.xml file.xsl

assuming output is an html file, if it is an xml file use the following command---


java jar saxon9he.jar ---o :output.xml input.xml file.xsl

You might also like