WIX (Web Interface for XQuery) is a simple service that allows users to submit an XQuery to query an XML document. The servlet interface for submitting XQueries is simple and efficient and can easily be called from any programming language, other instances of XQuery, or an HTML form.
Under the hood, WIX uses the Saxon XQuery Engine to do the heavy lifting.
By offering a service that accepts XQueries and generates XML results, WIX implements the query shipping paradigm (as opposed to document shipping which is a standard part of XQuery). Query shipping has several advantages over document shipping:
The main disadvantage to shipping queries instead of documents is that because it isn't a standard part of XQuery, the syntax can become a little more difficult. This is only a problem when calling from XQuery and the solution is just to be careful about escaping strings.
Details of using WIX and a live WIX demo are available on the Using WIX - Web Interface for
XQuery page. The demo and examples use the bib.xml
sample file from W3C XQuery Use Cases.
To deploy WIX to your Servlet container, we have provided a simple program that generates a WAR file containing your XML file and optionally your schema file.
To finish the process, you will need to deploy your WAR file to the server. This varies from server to server and so you should check your vendor's documentation. We have included the following instructions if you use Tomcat:
These are problems that you may encounter, please see your server documentation for specific solutions
Problem: I get an OutOfMemory error!
Solution: Java requires that applications specify the maximum amount of memory they will
use. This number is likely set in the batch file or shell script that launched your server. If you
find a line that contains the string "Xmx
" then you can set the memory there with
Xmx=512m
. Remember that each document will need about 5 times as much memory as its size.
Problem: When I submit a very long query using the XQuery API, it doesn't return a result.
Solution: The problem is that some servers sets a maximum length for a URL. This limit will
likely work for most queries, but in some cases you will need to increase it. For example, in
tomcat's server.xml
you can do this by adding maxHttpHeaderSize="8192"
to
the <Connector>
stanza.