1,372 bytes added
, 18:01, 15 June 2012
This [[Module Library|XQuery Module]] contains functions to evaluate XQuery strings and modules at runtime.
=Conventions=
All functions in this module are assigned to the {{Code|http://basex.org/modules/xquery}} namespace, which is statically bound to the {{Code|xquery}} prefix.<br/>
All errors are assigned to the {{Code|http://basex.org/errors}} namespace, which is statically bound to the {{Code|bxerr}} prefix.
=Functions=
==xquery:eval==
{|
|-
| width='90' | '''Signatures'''
|{{Func|xquery:eval|$expr as xs:string|item()*}}<br />
|-
| '''Summary'''
|Evaluates {{Code|$expr}} as XQuery expression at runtime and returns the resulting items.<br />
|-
| '''Examples'''
|
* {{Code|xquery:eval("1+3")}} returns {{Code|4}}.<br />
|}
==xquery:invoke==
{|
|-
| width='90' | '''Signatures'''
|{{Func|xquery:invoke|$uri as xs:string|item()*}}<br />
|-
| '''Summary'''
|Opens {{Code|$uri}} as file, evaluates it as XQuery expression at runtime, and returns the resulting items.<br />
|}
==util:type==
Added in {{Version|7.2}}.
{|
|-
| width='90' | '''Signatures'''
|{{Func|xquery:type|$expr as item()*|item()*}}
|-
| '''Summary'''
|Similar to {{Code|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.
[[Category:XQuery]]