Main menu:

Site search

Feeds

Categories

December 2014
S M T W T F S
« Sep    
 123456
78910111213
14151617181920
21222324252627
28293031  

Archive

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):


uri="http://exist-db.org/ant">




/>





More to come as I make this more useful.

Comments

Comment from Kevin S. Clarke
Time: March 30, 2006, 4:24 pm

Very nice! Have you looked at Qexo (http://www.gnu.org/software/qexo/) as a way to do it without exist? It doesn’t have all the eXist specific XUpdate stuff (built into XQ now), but does standard XQuery processing.

Pingback from Solvitur ambulando » running xquery as an ant task with qexo
Time: June 8, 2011, 10:19 am

[...] to Kevin, who suggested I use Qexo to run xqueries in ant without having to use eXist. It [...]

Write a comment