wiki:SaxonWebService

Version 4 (modified by ebmoore, 11 years ago) (diff)

--

Wix


Eider Moore


Overview

The Saxon Web Service is designed to pre-load a single document into Saxon and then run queries on that document. It is a fairly straight forward design, but it does use quite a bit of memory (at least 5x the document size).

Deploy

There is now a small deploy script that creates a war file that points to your target xml: Wix.zip

Usage

The preferred usage is the servlet with the query bound to the variable query. The servlet will be more efficient when large result sets are returned.

The document's root node is bound to $root (and for backwards compatibility $pv, please use $root on all future queries).

Bugs/Issues?

  1. It is a memory/garbage hog. See JavaHints
  2. Not all XQueries are supported because variables are currently added at the top of the query. This means that any of the 1st pragmas (namespace declarations and module imports) are unlikely to work.

Documentation

No javadoc yet... ##javadoc...

Source Home

The source lives in the experimental SubVersion repository under SaxonWebService.

Required Libraries

  1. Saxon

Downloads

There is now a small deploy script that creates a war file that points to your target xml: Wix.zip

Example

From XQuery

let $q := 
"<results> 
{
for $p in $root/patient 
        return 
        <patient> 
                {$p/pnum} 
        </patient> 
}
</results>"

let $a := doc(concat("http://cuboid.biostr.washington.edu:8080/SaxonWebService/XQuerylet?query=", escape-uri($q)))
return 
<allpatients>
{$a}
</allpatients>