Database Reference
In-Depth Information
The absence of the features does not mean that eXist is not type-
safe; it is, very much so. It only means that type checking based on
schema imports is not implemented.
eXist tested its implementation against the official XQuery Test Suite (XQTS version
1.0.2). Of the more than 14,000 tests, it passed over 99%.
eXist does not yet type-check the
name
of an element or attribute.
So, strangely enough, you can write
let $elm as element(a) :=
<b/>
and eXist will find it absolutely OK, although this is a relaxa‐
tion from the XQuery specification. The advice is not to use name
tests in element or attribute data type specifications, though. So,
use
element()
or
attribute()
instead of
element(a)
or
attribute(b)
, since specifying a name implies type checking that
alas never occurs.
XQuery 3.0 Support
New since version 2.0 is eXist's support for
XQuery 3.0
.
As of writing, this specifica‐
tion had reached Proposed Recommendation status and several partial implementa‐
tions were available.
To enable the XQuery 3.0 support, start your XQuery program with:
xquery
version
"3.0"
;
XQuery 3.0 is a relatively new and probably not yet very well known standard. There‐
fore, the support eXist offers is handled in somewhat more detail next. For the exact
XPath 3.0 functions
Many of the extra functions defined in XPath and XQuery 3.0 are implemented.
Among them are some very useful ones, like
format-dateTime
.
An exact list of what is available and what isn't can be found with the XQuery Func‐
tion Documentation browser in the dashboard. Browse the
http://www.w3.org/
2005/xpath-functions
module.
try/catch
The XQuery 3.0
try
/
catch
mechanism allows you to catch errors raised during exe‐
cution. These can be errors raised by the XQuery engine (meaning your code did
something wrong), or errors you've explicitly raised with the
error
function. The
Search WWH ::
Custom Search