6.3. Querying an instance file

The main motivation for using XQuery is for querying XML databases. Most commercial relational database systems now offer a way to keep and select information in XML but some XML native databases have been developed. eXist-db [66] is an open source database management system that stores XML data according to the XML data model and features efficient index-based XQuery processing.

XQuery can be called from the command line with the Saxon jar library [82]. For example, calling the query Example 6.1 and giving white as value of the $color parameter can be done as follows:

java -cp /path/to/the/SAXON.jar net.sf.saxon.Query -s WineCatalog.xml  \
       -q WineCatalog.xq color=white > whites.html