Database Reference
In-Depth Information
Figure 14-5. Creating a validation scenario for use with eXist
• To execute an XQuery script directly from oXygen, create a transformation sce‐
nario that uses your eXist connection as its transformer. Transform the XQuery
script using this scenario and it will run inside eXist, returning the results to
oXygen.
Ant and eXist
Many Java programmers know the Ant build tool . It is used for automating build
processes, including maintenance work like creating files and directories, as well as
creating zip files.
eXist contains a library that extends Ant so you may work with the database from
inside your Ant scripts. This is useful for automating common tasks like backups,
restores, and data import/export. More advanced capabilities include running XQu‐
eries and user management.
For simple scripts, Ant and the eXist Ant extensions are sufficient. However, if you
need more complicated functionality, like iterating over collections and resources,
you also need Ant-Contrib , a library containing generic extensions for common Ant
functionality.
Trying the Ant Examples
There is an example build.xml script in the folder chapters/tools of the book-code Git
repository (see “Getting the Source Code” on page 15 ). It contains several targets that
illustrate what you can do with Ant and eXist together. To try it, do the following:
 
Search WWH ::




Custom Search