Implementations
This document discusses the four XQuery implementations discussed in the book: BaseX, eXist, Saxon, and oXygen XML Editor. It lists key links, describes support for the XQuery specifications, and provides chapter-specific notes.
BaseX
BaseX links
- Homepage: http://basex.org
- Documentation: http://docs.basex.org/wiki/Main_Page
- Source code: https://github.com/basexdb/basex
- Mailing list: basex-talk
- Stack Overflow: Questions tagged basex
XQuery coverage in BaseX
BaseX has posted full notes on its conformance with XQuery 3.1 and related standards. The following information is current as of BaseX 9.3.1.
- BaseX supports all of XQuery 3.1 Functions and Operators, except for the following (note that all functions covered in the book have alternatives listed):
fn:collation-key()
fn:load-xquery-module()
fn:transform()
(use BaseX’sxslt:transform()
function)
Chapter-specific notes for BaseX
- Chapter 9
fn:put()
writes documents to “secondary storage”. See BaseX’s documentation for discussion of this function and a link to “Additional database functions exist for performing updates on document and database level.”
eXist
eXist links
- Homepage: https://exist-db.org
- Documentation: https://exist-db.org/exist/apps/doc
- Source code: https://github.com/eXist-db/exist
- Mailing list: exist-open
- Stack Overflow: Questions tagged exist-db
XQuery coverage in eXist
eXist has posted full notes on its conformance with XQuery 3.1 and related standards. The following list is current as of eXist v6.2.0.
- eXist has implemented all of XQuery 3.1, except:
- Count clause (introduced in Chapter 7; pre-sorting results and using the
at
clause can generally be substituted) - Windowing (introduced in Chapter 7)
- Count clause (introduced in Chapter 7; pre-sorting results and using the
- eXist has not implemented the following related specifications:
- XQuery Update Facility 3.0 (introduced in Chapter 9). Instead, it provides an eXist-specific update facility.
- XPath and XQuery Full Text 3.0 (introduced in Chapter 10). Instead, it provides a full text search module based on Apache Lucene.
Chapter-specific notes for eXist
- Chapter 9
- eXist does not support the XQuery Update Facility 3.0. Instead, use the eXist-specific update facility, which can perform all of the same functions.
- As a substitute for the
fn:put()
function, introduced in XQuery Update Facility 3.0, usexmldb:store()
to store documents or resources in the database orfile:serialize()
to store XML documents on the file system. (See alsofile:serialize-binary()
to store non-XML resources to the file system.) - eXist does not require the
%updating
annotation to be added to functions that contain updating expressions. Nor does it require the%simple
annotation to be added to non-updating functions.
- Chapter 10
- eXist does not support the XPath and XQuery Full Text Facility 3.0 (introduced in Chapter 10). Instead, it provides a full text search module based on Apache Lucene, which can perform many of the same functions, as well as other functions not provided by the XQuery Full Text Facility.
Saxon
Saxon is oXygen’s default, built-in XQuery engine. It can also be called via the command line.
Saxon links
- Homepage: https://www.saxonica.com
- Documentation: https://www.saxonica.com/documentation/documentation.xml
- Source code: https://www.saxonica.com/html/documentation/about/resources.html
- Mailing list: saxon-help
- Stack Overflow: Questions tagged saxon
XQuery coverage in Saxon
Saxon has posted full notes on its conformance with XQuery 3.1 and related standards.
- Saxon supports the full XQuery 3.1 Functions and Operators specification.
- Saxon has not implemented the following related specifications:
- XQuery Update Facility 3.0 (introduced in Chapter 9), but implements XQuery Update Facility 1.0 as extensions to the XQuery 3.1 grammar.
- XQuery Full Text Facility 3.0 (introduced in Chapter 10). Saxon provides no full text search facility.
- The different editions of Saxon implement different levels of XQuery 3.1:
- Saxon-HE (the free, open source edition) implements XQuery 3.1 at the Minimal Conformance level, plus the Module Feature and the Serialization Feature.
- Saxon-PE (commercial, included in oXygen) adds support for the Higher-Order Function Feature.
- Saxon-EE (commercial, included in oXygen) adds support for the Schema Aware Feature and the Typed Data Feature.
Chapter-specific notes for Saxon
- Chapter 4
- Saxon complains when serializing a free-standing attribute node (04-13, 04-15). As a workaround, add
/fn:string()
to the expression to retrieve the string value of the attribute.
- Saxon complains when serializing a free-standing attribute node (04-13, 04-15). As a workaround, add
- Chapter 5
- oXygen 20.1 (which bundles Saxon 9.8.0.12) returns no results for 05-23, but Saxon 9.9.0.1 returns the expected result.
- Chapter 7
- As noted in the note in the text, oXygen complains when serializing non-XML items like maps, arrays, or functions. Use the workaround noted in the text, the
fn:serialize()
function. (Also affects Chapter 12.) - When using functions in the
map
orarray
namespace, these namespaces must be declared in the prolog.
- As noted in the note in the text, oXygen complains when serializing non-XML items like maps, arrays, or functions. Use the workaround noted in the text, the
- Chapter 9
- When running 09-05 in oXygen, must enable “linked tree model” in Preferences > Saxon HE/PE/EE Options. I was unable to get the
-tree:linked
flag to work when executing this query on the command line. - 09-11 thru 09-13 complains of “unexpected token name ‘transform’ beyond end of query
- When running 09-05 in oXygen, must enable “linked tree model” in Preferences > Saxon HE/PE/EE Options. I was unable to get the
- Chapter 12
- The
fn:json-to-xml()
function used in 12-07 fails when the “linked tree model” is enabled; the error is “missing call on startContent()”; disabling this allows the function to work
- The
oXygen XML Editor
oXygen links
- Homepage: https://www.oxygenxml.com
- Documentation: https://www.oxygenxml.com/doc/versions/22.0/ug-editor/index.html
- Mailing list: oxygen-user
- Forum: oXygen Forums
XQuery coverage in oXygen
- By default, oXygen is configured to use Saxon as its XQuery engine. For information on Saxon, see above.
- oXygen can also be configured to use eXist as its XQuery engine. This is configured via Preferences > XQuery > XML > XSLT-FO-XQuery > XQuery > Validation engine. For information on eXist, see above.