Difference between revisions of "XQuery Module"

From BaseX Documentation
Jump to navigation Jump to search
Line 45: Line 45:
 
=Changelog=
 
=Changelog=
  
This module was introduced with Version 7.3.
+
This module was introduced with Version 7.3. Functions have been adopted from the obsolete Utility Module.
  
 
[[Category:XQuery]]
 
[[Category:XQuery]]

Revision as of 18:28, 15 June 2012

This XQuery Module contains functions to evaluate XQuery strings and modules at runtime.

Conventions

All functions in this module are assigned to the http://basex.org/modules/xquery namespace, which is statically bound to the xquery prefix.
All errors are assigned to the http://basex.org/errors namespace, which is statically bound to the bxerr prefix.

Functions

xquery:eval

Signatures xquery:eval($expr as xs:string) as item()*
Summary Evaluates $expr as XQuery expression at runtime and returns the resulting items.
Examples
  • xquery:eval("1+3") returns 4.

xquery:invoke

Signatures xquery:invoke($uri as xs:string) as item()*
Summary Opens $uri as file, evaluates it as XQuery expression at runtime, and returns the resulting items.

xquery:type

Added in Version 7.2.

Signatures xquery:type($expr as item()*) as item()*
Summary Similar to fn:trace($expr, $msg), but instead of a user-defined message, it emits the compile-time type and estimated result size of its argument.

Changelog

This module was introduced with Version 7.3. Functions have been adopted from the obsolete Utility Module.