running xquery as an ant task with eXist
Say you wanted to be able to pull info out of one xml document and plug it into another document using an ant task. Why, then it would be very handy to be able to run xquery from within ant. Luckily, eXist has published tools for doing just this. Eventually, I would like to get this working with non-exist xqueries, but for now here is how to get it working with eXist. There is documentation on the eXist website here, but it is incomplete and contains some errors. It is useful for knowing all the ant tasks that are available, though.
Make sure you have the eXist source files. If you installed the .jar version (I don’t think the .war version includes source) you should be good. Check to see if you have the file $EXIST/src/org/exist/ant/antlib.xml
Here is a build file that will create a database called test, and will perform a simple xquery (don’t forget to change the location of exist.home to whereever yours is installed):
More to come as I make this more useful.