Tuesday, February 5, 2008

Using Saxon 9, Eclipse and Ant

I found this article whilst searching for a way to get Saxon 9 to step in and take control of xslt transforms inside Ant tasks:

http://www.saxonica.com/documentation/using-xsl/xsltfromant.html

The method outlined by Michael Kay looked like it was written for the commercial version of Saxon (SA).

Here's what I did to get Saxon 9B (the sourceforge edition) to work inside an ant task:

<?xml version="1.0" encoding="UTF-8"?>
<project default="test-xslt2" basedir=".">

<target name="test-xslt2">
<taskdef name="saxon-xslt" classname="net.sf.saxon.ant.AntTransform" classpath="c:\lib\saxon9.jar;c:\lib\saxon9-ant.jar"/>

<saxon-xslt
in="your-xml-data.xml"
out="transformed-file.xhtml"
style="xsl-stylesheet.xsl"
force="true">
</saxon-xslt>

</target>

</project>

1 comments:

David Carver said...

You might be interested in the eclipse XSL Tooling project which aims to add XSL support to the eclipse web tools project.

http://www.eclipse.org/webtools/incubator

Blog Archive

About Me