Apache Ant/XQuery

Motivation
You want to transform an XML document with XQuery using an ant task.

Method
We will use the Saxon library to demonstrate this.

Steps:
 * 1) Download the Saxon library from Sourceforge
 * 2) Download a sample XQuery from the samples (for example tour.xq from the samples area)
 * 3) Copy the Saxon jar file into your project.  In the example below just a single jar file is copied into the location saxonhe9-2-0-6j/saxon9he.jar

Sample Ant Target
This sample uses the java task to run an XQuery program using the Saxon Java library. In the example below the XQuery tour.xq is executed and the output is copied into the file output.html.

Note that the starting point is set by passing the arg as a parameter to the XQuery.