Difference between revisions of "XQuery Errors"

From BaseX Documentation
Jump to navigation Jump to search
(42 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This article is part of the [[XQuery|XQuery Portal]].
+
This article is part of the [[XQuery|XQuery Portal]]. It summarizes the codes of errors that are raised by the standard features and functions of XQuery. As the original specifications are pretty comprehensive, we tried our best to make this overview comprehensible to a wider range of readers.
It summarizes all error codes that may be thrown by the BaseX XQuery processor.
 
  
As the original specifications are rather bulky and meticulous,
+
The following tables list the error codes that are known to BaseX, a short description, and examples of queries raising that errors. Errors that are specific to BaseX can be found in the descriptions of the respective [[Module Library|modules]].
we tried our best to make this overview comprehensible to a wider
 
range of readers. The following tables list the error codes that
 
are known to BaseX, a short description, and examples of queries
 
raising that errors.
 
  
Original definitions of the error codes are found in the
+
Original definitions of the error codes are found in the [http://www.w3.org/TR/xquery-30/ XQuery 3.0], [http://www.w3.org/TR/xpath-functions-30/ XQuery 3.0 Functions], [http://www.w3.org/TR/xquery-update-10/ XQuery 1.0 Update], [http://www.w3.org/TR/xpath-full-text-10/ XQuery 1.0 Full Text], and [http://www.expath.org/spec/http-client EXPath HTTP] Specifications.
[http://www.w3.org/TR/xquery-30/ XQuery 3.0],
 
[http://www.w3.org/TR/xpath-functions-30/ XQuery 3.0 Functions],
 
[http://www.w3.org/TR/xquery-update-10/ XQuery 1.0 Update],
 
[http://www.w3.org/TR/xpath-full-text-10/ XQuery 1.0 Full Text],
 
and [http://www.expath.org/spec/http-client EXPath HTTP]
 
Specifications.
 
  
==BaseX Errors==
+
=Static Errors=
  
Error Codes: {{Code|BASX}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|XPST}}, {{Code|XQST}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="60%"|Description
+
! width="50%" |Description
! width="35%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|BASX0000}}
+
|<code>XPST0003</code>
| Generic error, which is used for exceptions in [[Java Bindings#Context-Awareness|context-aware Java bindings]].
 
|
 
|- valign="top" scope="row"
 
|{{Code|BASX0001}}
 
| The current user has insufficient [[User Management|permissions]] to execute an expression.
 
|{{Code|file:delete('file.txt')}}: ''Create'' rights needed.
 
|- valign="top" scope="row"
 
|{{Code|BASX0002}}
 
| The specified database option is unknown.
 
| {{Code|declare option db:xyz "no"; 1}}
 
|}
 
 
 
Additional, module-specific error codes are listed in the descriptions of the query modules.
 
 
 
==Static Errors==
 
 
 
Error Codes: {{Code|XPST}}, {{Code|XQST}}
 
 
 
{| class="wikitable" width="100%"
 
! width="5%"|Code
 
! width="60%"|Description
 
! width="45%"|Examples
 
|- valign="top" scope="row"
 
|{{Code|XPST0003}}
 
 
|An error occurred while ''parsing'' the query string (i.e., before the query could be compiled and executed). This error is the most common one, and may be accompanied by a variety of different error messages.  
 
|An error occurred while ''parsing'' the query string (i.e., before the query could be compiled and executed). This error is the most common one, and may be accompanied by a variety of different error messages.  
|{{Code|1+<hr/>for i in //* return $i}}
+
|<code>1+<hr/>for i in //* return $i</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPST0005}}
+
|<code>XPST0005</code>
|An expression will never results, no matter what input will be processed.
+
|An expression will never return any results, no matter what input is provided.
|{{Code|doc('input')/..}}
+
|<code>doc('input')/..</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPST0008}}
+
|<code>XPST0008</code>
 
|A variable or type name is used that has not been defined in the current scope.
 
|A variable or type name is used that has not been defined in the current scope.
|{{Code|$a---<hr/>element(*, x)}}
+
|<code>$a---<hr/>element(*, x)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPST0017}}
+
|<code>XPST0017</code>
| • The specified function is unknown, or<br />• it uses the wrong number of arguments.
+
| • The specified function is unknown,<br />• it uses the wrong number of arguments, or, when calling Java functions:<br />• there is more than one function with the same number of arguments.
|{{Code|unknown()<hr/>count(1,2,3)}}
+
|<code>unknown()<hr/>count(1,2,3)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPST0051}}
+
|<code>XPST0051</code>
 
| An unknown QName is used in a ''sequence type'' (e.g. in the target type of the {{Code|cast}} expression).
 
| An unknown QName is used in a ''sequence type'' (e.g. in the target type of the {{Code|cast}} expression).
|{{Code|1 instance of x<hr/>"test"&nbsp;cast&nbsp;as&nbsp;xs:itr}}
+
|<code>1 instance of x<hr/>"test"&nbsp;cast&nbsp;as&nbsp;xs:itr</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPST0080}}
+
|<code>XPST0080</code>
| {{Code|xs:NOTATION}} or {{Code|xs:anyAtomicType}} is used as target type of {{Code|cast}} or {{Code|castable}}.
+
|<code>xs:NOTATION</code> or {{Code|xs:anyAtomicType}} is used as target type of {{Code|cast}} or {{Code|castable}}.
|{{Code|1 castable as xs:NOTATION}}
+
|<code>1 castable as xs:NOTATION</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPST0081}}
+
|<code>XPST0081</code>
 
| • A QName uses a prefix that has not been bound to any namespace, or<br />• a pragma or option declaration has not been prefixed.
 
| • A QName uses a prefix that has not been bound to any namespace, or<br />• a pragma or option declaration has not been prefixed.
 
|<code>unknown:x<hr/>(# pragma #) { 1 }</code>
 
|<code>unknown:x<hr/>(# pragma #) { 1 }</code>
Line 79: Line 46:
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0009}}
+
|<code>XQST0009</code>
 
| The query imports a schema (schema import is not supported by BaseX).
 
| The query imports a schema (schema import is not supported by BaseX).
|{{Code|import schema "x"; ()}}
+
|<code>import schema "x"; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0022}}
+
|<code>XQST0022</code>
 
| Namespace values must be constant strings.
 
| Namespace values must be constant strings.
 
|<code><elem xmlns="{ 'dynamic' }"/></code>
 
|<code><elem xmlns="{ 'dynamic' }"/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0031}}
+
|<code>XQST0031</code>
 
| The specified XQuery version is not specified.
 
| The specified XQuery version is not specified.
|{{Code|xquery version "9.9"; ()}}
+
|<code>xquery version "9.9"; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0032}}
+
|<code>XQST0032</code>
 
| The base URI was declared more than once.
 
| The base URI was declared more than once.
|{{Code|declare base-uri ...}}
+
|<code>declare base-uri ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0033}}
+
|<code>XQST0033</code>
 
| A namespace prefix was declared more than once.
 
| A namespace prefix was declared more than once.
|{{Code|declare namespace a="a";<br/>declare namespace a="b"; ()}}
+
|<code>declare namespace a="a";<br/>declare namespace a="b"; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0034}}
+
|<code>XQST0034</code>
 
| A function was declared more than once.
 
| A function was declared more than once.
 
|<code>declare function local:a() { 1 };<br/>declare function local:a() { 2 }; local:a()</code>
 
|<code>declare function local:a() { 1 };<br/>declare function local:a() { 2 }; local:a()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0038}}
+
|<code>XQST0038</code>
 
| The default collation was declared more than once.
 
| The default collation was declared more than once.
|{{Code|declare default collation ...}}
+
|<code>declare default collation ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0039}}
+
|<code>XQST0039</code>
 
| Two or more parameters in a user-defined function have the same name.
 
| Two or more parameters in a user-defined function have the same name.
 
|<code>declare function local:fun($a, $a) { $a * $a };<br/>local:fun(1,2)</code>
 
|<code>declare function local:fun($a, $a) { $a * $a };<br/>local:fun(1,2)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0040}}
+
|<code>XQDY0040</code>
 
| Two or more attributes in an element have the same node name.
 
| Two or more attributes in an element have the same node name.
|{{Code|<elem a="1" a="12"/>}}
+
|<code><elem a="1" a="12"/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0045}}
+
|<code>XQDY0045</code>
 
| A user-defined function uses a reserved namespace.
 
| A user-defined function uses a reserved namespace.
 
|<code>declare function fn:fun() { 1 }; ()</code>
 
|<code>declare function fn:fun() { 1 }; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0047}}
+
|<code>XQST0047</code>
 
| A module was defined more than once.
 
| A module was defined more than once.
|{{Code|import module ...}}
+
|<code>import module ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0048}}
+
|<code>XQST0048</code>
 
| A module declaration does not match the namespace of the specified module.
 
| A module declaration does not match the namespace of the specified module.
|{{Code|import module namespace invalid="uri"; 1}}
+
|<code>import module namespace invalid="uri"; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0049}}
+
|<code>XQST0049</code>
 
| A global variable was declared more than once.
 
| A global variable was declared more than once.
|{{Code|declare variable $a := 1;<br/>declare variable $a := 1; $a}}
+
|<code>declare variable $a := 1;<br/>declare variable $a := 1; $a</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0054}}
+
|<code>XQST0054</code>
 
| A global variable depends on itself. This may be triggered by a circular variable definition.
 
| A global variable depends on itself. This may be triggered by a circular variable definition.
 
|<code>declare variable $a := local:a();<br/>declare function local:a() { $a }; $a</code>
 
|<code>declare variable $a := local:a();<br/>declare function local:a() { $a }; $a</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0055}}
+
|<code>XQST0055</code>
 
| The mode for copying namespaces was declared more than once.
 
| The mode for copying namespaces was declared more than once.
|{{Code|declare copy-namespaces ...}}
+
|<code>declare copy-namespaces ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0057}}
+
|<code>XQST0057</code>
 
| The namespace of a schema import may not be empty.
 
| The namespace of a schema import may not be empty.
|{{Code|import schema ""; ()}}
+
|<code>import schema ""; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0059}}
+
|<code>XQST0059</code>
 
| The schema or module with the specified namespace cannot be found or processed.
 
| The schema or module with the specified namespace cannot be found or processed.
|{{Code|import module "unknown"; ()}}
+
|<code>import module "unknown"; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0060}}
+
|<code>XQST0060</code>
 
| A user-defined function has no namespace.
 
| A user-defined function has no namespace.
 
|<code>declare default function namespace "";<br/>declare function x() { 1 }; 1</code>
 
|<code>declare default function namespace "";<br/>declare function x() { 1 }; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0065}}
+
|<code>XQST0065</code>
 
| The ordering mode was declared more than once.
 
| The ordering mode was declared more than once.
|{{Code|declare ordering ...}}
+
|<code>declare ordering ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0065}}
+
|<code>XQST0065</code>
 
| The default namespace mode for elements or functions was declared more than once.
 
| The default namespace mode for elements or functions was declared more than once.
|{{Code|declare default element namespace ...}}
+
|<code>declare default element namespace ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0067}}
+
|<code>XQST0067</code>
 
| The construction mode was declared more than once.
 
| The construction mode was declared more than once.
|{{Code|declare construction ...}}
+
|<code>declare construction ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0068}}
+
|<code>XQST0068</code>
 
| The mode for handling boundary spaces was declared more than once.
 
| The mode for handling boundary spaces was declared more than once.
|{{Code|declare boundary-space ...}}
+
|<code>declare boundary-space ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0069}}
+
|<code>XQST0069</code>
 
| The default order for empty sequences was declared more than once.
 
| The default order for empty sequences was declared more than once.
|{{Code|declare default order empty ...}}
+
|<code>declare default order empty ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0070}}
+
|<code>XQST0070</code>
 
| A namespace declaration overwrites a reserved namespace.
 
| A namespace declaration overwrites a reserved namespace.
|{{Code|declare namespace xml=""; ()}}
+
|<code>declare namespace xml=""; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0071}}
+
|<code>XQST0071</code>
 
| A namespace is declared more than once in an element constructor.
 
| A namespace is declared more than once in an element constructor.
|{{Code|<a xmlns="uri1" xmlns="uri2"/>}}
+
|<code><a xmlns="uri1" xmlns="uri2"/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0075}}
+
|<code>XQST0075</code>
 
| The query contains a validate expression (validation is not supported by BaseX).
 
| The query contains a validate expression (validation is not supported by BaseX).
 
|<code>validate strict { () }</code>
 
|<code>validate strict { () }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0076}}
+
|<code>XQST0076</code>
 
| A {{Code|group by}} or {{Code|order by}} clause specifies an unknown collation.
 
| A {{Code|group by}} or {{Code|order by}} clause specifies an unknown collation.
|{{Code|for $i in 1 to 10<br/>order by $i collation "unknown"<br/>return $i}}
+
|<code>for $i in 1 to 10<br/>order by $i collation "unknown"<br/>return $i</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0079}}
+
|<code>XQST0079</code>
 
| A pragma was specified without the expression that is to be evaluated.
 
| A pragma was specified without the expression that is to be evaluated.
 
|<code>(# xml:a #) {}</code>
 
|<code>(# xml:a #) {}</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0085}}
+
|<code>XQST0085</code>
 
| An empty namespace URI was specified.
 
| An empty namespace URI was specified.
|{{Code|<pref:elem xmlns:pref=""/>}}
+
|<code><pref:elem xmlns:pref=""/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0087}}
+
|<code>XQST0087</code>
 
| An unknown encoding was specified. Note that the encoding declaration is currently ignored in BaseX.
 
| An unknown encoding was specified. Note that the encoding declaration is currently ignored in BaseX.
|{{Code|xquery version "1.0" encoding "a b"; ()}}
+
|<code>xquery version "1.0" encoding "a b"; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0088}}
+
|<code>XQST0088</code>
 
| An empty module namespace was specified.
 
| An empty module namespace was specified.
|{{Code|import module ""; ()}}
+
|<code>import module ""; ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0089}}
+
|<code>XQST0089</code>
 
| Two variables in a {{Code|for}} or {{Code|let}} clause have the same name.
 
| Two variables in a {{Code|for}} or {{Code|let}} clause have the same name.
|{{Code|for $a at $a in 1 return $i}}
+
|<code>for $a at $a in 1 return $i</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0090}}
+
|<code>XQST0090</code>
 
| A character reference specifies an invalid character.
 
| A character reference specifies an invalid character.
|{{Code|"&#0;"}}
+
|<code>"&#0;"</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0093}}
+
|<code>XQST0093</code>
 
| A module depends on itself. This may be triggered by a circular module definition.
 
| A module depends on itself. This may be triggered by a circular module definition.
|{{Code|import module ...}}
+
|<code>import module ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0094}}
+
|<code>XQST0094</code>
| {{Code|group by}} references a variable that has not been declared before.
+
|<code>group by</code> references a variable that has not been declared before.
|{{Code|for $a in 1 group by $b return $a}}
+
|<code>for $a in 1 group by $b return $a</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0097}}
+
|<code>XQST0097</code>
 
| A {{Code|decimal-format}} property is invalid.
 
| A {{Code|decimal-format}} property is invalid.
|{{Code|declare default decimal-format digit = "xxx"; 1}}
+
|<code>declare default decimal-format digit = "xxx"; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0098}}
+
|<code>XQST0098</code>
 
| A single {{Code|decimal-format}} character was assigned to multiple properties.
 
| A single {{Code|decimal-format}} character was assigned to multiple properties.
|{{Code|declare default decimal-format digit = "%"; 1}}
+
|<code>declare default decimal-format digit = "%"; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0099}}
+
|<code>XQST0099</code>
 
| The context item was declared more than once.
 
| The context item was declared more than once.
|{{Code|declare context item ...}}
+
|<code>declare context item ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0107}}
+
|<code>XQST0106</code>
| The initializer of the context item depends on itself.
+
| An annotation has been declared twice in a variable or function declaration.
|{{Code|declare context item := .; ()}}
+
|<code>declare %updating %updating function ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0108}}
+
|<code>XQST0108</code>
 
| Output declarations may only be specified in the main module.
 
| Output declarations may only be specified in the main module.
|Module: {{Code|declare output ...}}
+
|Module: <code>declare output ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0109}}
+
|<code>XQST0109</code>
 
| The specified serialization parameter is unknown.
 
| The specified serialization parameter is unknown.
|{{Code|declare option output:unknown "..."; 1}}
+
|<code>declare option output:unknown "..."; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0110}}
+
|<code>XQST0110</code>
 
| A serialization parameter was specified more than once in the output declarations.
 
| A serialization parameter was specified more than once in the output declarations.
|{{Code|declare option output:indent "no";<br/>declare option output:indent "no"; 1}}
+
|<code>declare option output:indent "no";<br/>declare option output:indent "no"; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0111}}
+
|<code>XQST0111</code>
 
| A decimal format was declared more than once.
 
| A decimal format was declared more than once.
|{{Code|declare decimal-format ...}}
+
|<code>declare decimal-format ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0113}}
+
|<code>XQST0113</code>
 
| Context item values may only be in the main module.
 
| Context item values may only be in the main module.
|Module: {{Code|declare context item := 1;}}
+
|Module: <code>declare context item := 1;</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQST0114}}
+
|<code>XQST0114</code>
 
| A decimal-format property has been specified more than once.
 
| A decimal-format property has been specified more than once.
|{{Code|declare decimal-format EN NaN="!" NaN="?"; ()}}
+
|<code>declare decimal-format EN NaN="!" NaN="?"; ()</code>
 
|}
 
|}
  
==Type Errors==
+
=Type Errors=
  
Error Codes: {{Code|XPTY}}, {{Code|XQTY}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|XPTY}}, {{Code|XQTY}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="60%"|Description
+
! width="50%" |Description
! width="45%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPTY0004}}
+
|<code>XPTY0004</code>
 
| This error is raised if an expression has the wrong type, or cannot be cast into the specified type. It may be raised both statically (during query compilation) or dynamically (at runtime).
 
| This error is raised if an expression has the wrong type, or cannot be cast into the specified type. It may be raised both statically (during query compilation) or dynamically (at runtime).
|{{Code|1 + "A"<hr/>abs("a")<hr/>1 cast as xs:gYear}}
+
|<code>1 + "A"<hr/>abs("a")<hr/>1 cast as xs:gYear</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPTY0018}}
+
|<code>XPTY0018</code>
 
| The result of the last step in a path expression contains both nodes and atomic values.
 
| The result of the last step in a path expression contains both nodes and atomic values.
|{{Code|doc('input.xml')/(*, 1)}}
+
|<code>doc('input.xml')/(*, 1)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPTY0019}}
+
|<code>XPTY0019</code>
 
| The result of a step (other than the last step) in a path expression contains an atomic values.
 
| The result of a step (other than the last step) in a path expression contains an atomic values.
|{{Code|(1 to 10)/*}}
+
|<code>(1 to 10)/*</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQTY0024}}
+
|<code>XQTY0024</code>
 
| An attribute node cannot be bound to its parent element, as other nodes of a different type were specified before.
 
| An attribute node cannot be bound to its parent element, as other nodes of a different type were specified before.
 
|<code><elem>text { attribute a { "val" } }</elem></code>
 
|<code><elem>text { attribute a { "val" } }</elem></code>
 +
|- valign="top" scope="row"
 +
|<code>XQTY0105</code>
 +
| A function item has been specified as content of an element.
 +
|<code><X>{ false#0 }</X></code>
 
|}
 
|}
  
==Dynamic Errors==
+
=Dynamic Errors=
  
Error Codes: {{Code|XPDY}}, {{Code|XQDY}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|XPDY}}, {{Code|XQDY}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="60%"|Description
+
! width="50%" |Description
! width="35%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPDY0002}}
+
|<code>XPDY0002</code>
 
| • No value has been defined for an external variable, or<br />• no context item has been set before the query was executed.
 
| • No value has been defined for an external variable, or<br />• no context item has been set before the query was executed.
|{{Code|declare variable $x external; $x<hr/>descendant::*}}
+
|<code>declare variable $x external; $x<hr/>descendant::*</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XPDY0050}}
+
|<code>XPDY0050</code>
 
| • The operand type of a {{Code|treat}} expression does not match the type of the argument, or<br/>• the root of the context item must be a document node.
 
| • The operand type of a {{Code|treat}} expression does not match the type of the argument, or<br/>• the root of the context item must be a document node.
|{{Code|"string" treat as xs:int<hr/>"string"[/]}}
+
|<code>"string" treat as xs:int<hr/>"string"[/]</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0025}}
+
|<code>XQDY0025</code>
 
| Two or more attributes in a constructed element have the same node name.
 
| Two or more attributes in a constructed element have the same node name.
 
|<code>element x { attribute a { "" } attribute a { "" } }</code>
 
|<code>element x { attribute a { "" } attribute a { "" } }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0026}}
+
|<code>XQDY0026</code>
 
| The content of a computed processing instruction contains "?>".
 
| The content of a computed processing instruction contains "?>".
 
|<code>processing-instruction pi { "?>" }</code>
 
|<code>processing-instruction pi { "?>" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0041}}
+
|<code>XQDY0041</code>
 
| The name of a processing instruction is invalid.
 
| The name of a processing instruction is invalid.
 
|<code>processing-instruction { "1" } { "" }</code>
 
|<code>processing-instruction { "1" } { "" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0043}}
+
|<code>XQDY0044</code>
 
| The node name of an attribute uses reserved prefixes or namespaces.
 
| The node name of an attribute uses reserved prefixes or namespaces.
 
|<code>attribute xmlns { "etc" }</code>
 
|<code>attribute xmlns { "etc" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0064}}
+
|<code>XQDY0064</code>
 
| The name of a processing instruction equals "XML" (case insensitive).
 
| The name of a processing instruction equals "XML" (case insensitive).
 
|<code>processing-instruction xml { "etc" }</code>
 
|<code>processing-instruction xml { "etc" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0072}}
+
|<code>XQDY0072</code>
 
| The content of a computed comment contains "--" or ends with "-".
 
| The content of a computed comment contains "--" or ends with "-".
 
|<code>comment { "one -- two" }</code>
 
|<code>comment { "one -- two" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0074}}
+
|<code>XQDY0074</code>
 
| The name of a computed attribute or element is invalid, or uses an unbound prefix.
 
| The name of a computed attribute or element is invalid, or uses an unbound prefix.
 
|<code>element { "x y" } { "" }</code>
 
|<code>element { "x y" } { "" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0095}}
+
|<code>XQDY0095</code>
 
| A sequence with more than one item was bound to a {{Code|group by}} clause.
 
| A sequence with more than one item was bound to a {{Code|group by}} clause.
|{{Code|let $a := (1,2) group by $a return $a}}
+
|<code>let $a := (1,2) group by $a return $a</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XQDY0096}}
+
|<code>XQDY0096</code>
 
| The node name of an element uses reserved prefixes or namespaces.
 
| The node name of an element uses reserved prefixes or namespaces.
 
|<code>element { QName("uri", "xml:n") } {}</code>
 
|<code>element { QName("uri", "xml:n") } {}</code>
 +
|- valign="top" scope="row"
 +
|<code>XQDY0101</code>
 +
| Invalid namespace declaration.
 +
|<code>namespace xmlns { 'x' }</code>
 +
|- valign="top" scope="row"
 +
|<code>XQDY0102</code>
 +
| Duplicate namespace declaration.
 +
|<code>element x { namespace a {'b'}, namespace a {'c'} }</code>
 
|}
 
|}
  
==Functions Errors==
+
=Functions Errors=
  
Error Codes: {{Code|FOAR}}, {{Code|FOCA}}, {{Code|FOCH}}, {{Code|FODC}}, {{Code|FODF}}, {{Code|FODT}}, {{Code|FOER}}, {{Code|FOFD}}, {{Code|FONS}}, {{Code|FORG}}, {{Code|FORX}}, {{Code|FOTY}}, {{Code|FOUT}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|FOAR}}, {{Code|FOCA}}, {{Code|FOCH}}, {{Code|FODC}}, {{Code|FODF}}, {{Code|FODT}}, {{Code|FOER}}, {{Code|FOFD}}, {{Code|FONS}}, {{Code|FORG}}, {{Code|FORX}}, {{Code|FOTY}}, {{Code|FOUT}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="50%"|Description
+
! width="50%" |Description
! width="45%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOAR0001}}
+
|<code>FOAR0001</code>
 
| A value was divided by zero.
 
| A value was divided by zero.
|{{Code|1 div 0}}
+
|<code>1 div 0</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOAR0002}}
+
|<code>FOAR0002</code>
 
| A numeric declaration or operation causes an over- or underflow.
 
| A numeric declaration or operation causes an over- or underflow.
|{{Code|12345678901234567890<hr/>xs:double("-INF") idiv 1}}
+
|<code>12345678901234567890<hr/>xs:double("-INF") idiv 1</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOCA0002}}
+
|<code>FOCA0002</code>
 
| • A float number cannot be converted to a decimal or integer value, or<br />• a function argument cannot be converted to a valid QName.
 
| • A float number cannot be converted to a decimal or integer value, or<br />• a function argument cannot be converted to a valid QName.
|{{Code|xs:int(xs:double("INF"))<hr/>QName("", "el em")}}
+
|<code>xs:int(xs:double("INF"))<hr/>QName("", "el em")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOCA0003}}
+
|<code>FOCA0003</code>
 
| A value is too large to be represented as integer.
 
| A value is too large to be represented as integer.
|{{Code|xs:integer(99e100)}}
+
|<code>xs:integer(99e100)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOCA0005}}
+
|<code>FOCA0005</code>
| {{Code|"NaN"}} is supplied to duration operations.
+
|<code>"NaN"</code> is supplied to duration operations.
|{{Code|xs:yearMonthDuration("P1Y") * xs:double("NaN")}}
+
|<code>xs:yearMonthDuration("P1Y") * xs:double("NaN")</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOCH0001}}
+
|<code>FOCH0001</code>
 
| A codepoint was specified that does not represent a valid XML character.
 
| A codepoint was specified that does not represent a valid XML character.
|{{Code|codepoints-to-string(0)}}
+
|<code>codepoints-to-string(0)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOCH0002}}
+
|<code>FOCH0002</code>
 
| A unsupported collation was specified in a function.
 
| A unsupported collation was specified in a function.
|{{Code|compare('a', 'a', 'unknown')}}
+
|<code>compare('a', 'a', 'unknown')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOCH0003}}
+
|<code>FOCH0003</code>
 
| A unsupported normalization form was specified in a function.
 
| A unsupported normalization form was specified in a function.
|{{Code|normalize-unicode('a', 'unknown')}}
+
|<code>normalize-unicode('a', 'unknown')</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODC0001}}
+
|<code>FODC0001</code>
 
| The argument specified in {{Code|fn:id()}} or {{Code|fn:idref()}} must have a document node as root.
 
| The argument specified in {{Code|fn:id()}} or {{Code|fn:idref()}} must have a document node as root.
|{{Code|id("id0", <xml/>)}}
+
|<code>id("id0", <xml/>)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODC0002}}
+
|<code>FODC0002</code>
 
| The specified document resource cannot be retrieved.
 
| The specified document resource cannot be retrieved.
|{{Code|doc("unknown.xml")}}
+
|<code>doc("unknown.xml")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODC0004}}
+
|<code>FODC0004</code>
 
| The specified collection cannot be retrieved.
 
| The specified collection cannot be retrieved.
|{{Code|collection("unknown")}}
+
|<code>collection("unknown")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODC0005}}
+
|<code>FODC0005</code>
 
| The specified URI to a document resource is invalid.
 
| The specified URI to a document resource is invalid.
|{{Code|doc("<xml/>")}}
+
|<code>doc("<xml/>")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODC0006}}
+
|<code>FODC0006</code>
 
| The string passed to {{Code|fn:parse-xml()}} is not well-formed.
 
| The string passed to {{Code|fn:parse-xml()}} is not well-formed.
|{{Code|parse-xml("<x/")}}
+
|<code>parse-xml("<x/")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODC0007}}
+
|<code>FODC0007</code>
 
| The base URI passed to {{Code|fn:parse-xml()}} is invalid.
 
| The base URI passed to {{Code|fn:parse-xml()}} is invalid.
|{{Code|parse-xml("<x/>", ":")}}
+
|<code>parse-xml("<x/>", ":")</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODF1280}}
+
|<code>FODF1280</code>
 
| The name of the decimal format passed to {{Code|fn:format-number()}} is invalid.
 
| The name of the decimal format passed to {{Code|fn:format-number()}} is invalid.
|{{Code|format-number(1, "0", "invalid")}}
+
|<code>format-number(1, "0", "invalid")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODF1310}}
+
|<code>FODF1310</code>
 
| The picture string passed to {{Code|fn:format-number()}} is invalid.
 
| The picture string passed to {{Code|fn:format-number()}} is invalid.
|{{Code|format-number(1, "invalid")}}
+
|<code>format-number(1, "invalid")</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODT0002}}
+
|<code>FODT0001</code>
 +
| An arithmetic duration operation causes an over- or underflow.
 +
|<code>xs:date('2000-01-01') + xs:duration('P99999Y')</code>
 +
|- valign="top" scope="row"
 +
|<code>FODT0002</code>
 
| A duration declaration or operation causes an over- or underflow.
 
| A duration declaration or operation causes an over- or underflow.
|{{Code|implicit-timezone() div 0}}
+
|<code>implicit-timezone() div 0</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FODT0003}}
+
|<code>FODT0003</code>
 
| An invalid timezone was specified.
 
| An invalid timezone was specified.
|{{Code|adjust-time-to-timezone(xs:time("01:01:01"), xs:dayTimeDuration("PT20H"))}}
+
|<code>adjust-time-to-timezone(xs:time("01:01:01"), xs:dayTimeDuration("PT20H"))</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOER0000}}
+
|<code>FOER0000</code>
 
| Error triggered by the {{Code|fn:error()}} function.
 
| Error triggered by the {{Code|fn:error()}} function.
|{{Code|error()}}
+
|<code>error()</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOFD1340}}
+
|<code>FOFD1340</code>
 
| The picture string passed to {{Code|fn:format-date()}}, {{Code|fn:format-time()}} or {{Code|fn:format-dateTime()}} is invalid.
 
| The picture string passed to {{Code|fn:format-date()}}, {{Code|fn:format-time()}} or {{Code|fn:format-dateTime()}} is invalid.
|{{Code|format-date(current-date(), "[]")}}
+
|<code>format-date(current-date(), "[]")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOFD1350}}
+
|<code>FOFD1350</code>
 
| The picture string passed to {{Code|fn:format-date()}}, {{Code|fn:format-time()}} or {{Code|fn:format-dateTime()}} specifies an non-available component.
 
| The picture string passed to {{Code|fn:format-date()}}, {{Code|fn:format-time()}} or {{Code|fn:format-dateTime()}} specifies an non-available component.
|{{Code|format-time(current-time(), "[Y2]")}}
+
|<code>format-time(current-time(), "[Y2]")</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FONS0004}}
+
|<code>FONS0004</code>
 
| A function has a QName as argument that specifies an unbound prefix.
 
| A function has a QName as argument that specifies an unbound prefix.
|{{Code|resolve-QName("x:e", <e/>)}}
+
|<code>resolve-QName("x:e", <e/>)</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0001}}
+
|<code>FORG0001</code>
 
| A value cannot be cast to the required target type.
 
| A value cannot be cast to the required target type.
|{{Code|xs:integer("A")<hr/>1 + <x>a</x>}}
+
|<code>xs:integer("A")<hr/>1 + <x>a</x></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0002}}
+
|<code>FORG0002</code>
 
| The URI passed to {{Code|fn:resolve-URI()}} is invalid.
 
| The URI passed to {{Code|fn:resolve-URI()}} is invalid.
|{{Code|resolve-URI(":")}}
+
|<code>resolve-URI(":")</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0003}}
+
|<code>FORG0003</code>
| {{Code|fn:zero-or-one()}} was called with more than one item.
+
|<code>fn:zero-or-one()</code> was called with more than one item.
|{{Code|zero-or-one((1, 2))}}
+
|<code>zero-or-one((1, 2))</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0004}}
+
|<code>FORG0004</code>
| {{Code|fn:one-or-more()}} was called with zero items.
+
|<code>fn:one-or-more()</code> was called with zero items.
|{{Code|one-or-more(())}}
+
|<code>one-or-more(())</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0005}}
+
|<code>FORG0005</code>
| {{Code|fn:exactly-one()}} was called with zero or more than one item.
+
|<code>fn:exactly-one()</code> was called with zero or more than one item.
|{{Code|exactly-one((1, 2))}}
+
|<code>exactly-one((1, 2))</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0006}}
+
|<code>FORG0006</code>
 
| A wrong argument type was specified in a function call.
 
| A wrong argument type was specified in a function call.
|{{Code|sum((1, "string"))}}
+
|<code>sum((1, "string"))</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORG0008}}
+
|<code>FORG0008</code>
 
| The arguments passed to {{Code|fn:dateTime()}} have different timezones.
 
| The arguments passed to {{Code|fn:dateTime()}} have different timezones.
|{{Code|dateTime(xs:date("2001-01-01+01:01"), current-time())}}
+
|<code>dateTime(xs:date("2001-01-01+01:01"), current-time())</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORX0001}}
+
|<code>FORX0001</code>
 
| A function specifies an invalid regular expression flag.
 
| A function specifies an invalid regular expression flag.
|{{Code|matches('input', 'query', 'invalid')}}
+
|<code>matches('input', 'query', 'invalid')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORX0002}}
+
|<code>FORX0002</code>
 
| A function specifies an invalid regular expression.
 
| A function specifies an invalid regular expression.
|{{Code|matches('input', '[')}}
+
|<code>matches('input', '[')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORX0003}}
+
|<code>FORX0003</code>
 
| A regular expression matches an empty string.
 
| A regular expression matches an empty string.
|{{Code|tokenize('input', '.?')}}
+
|<code>tokenize('input', '.?')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FORX0004}}
+
|<code>FORX0004</code>
 
| The replacement string of a regular expression is invalid.
 
| The replacement string of a regular expression is invalid.
|{{Code|replace("input", "match", "\")}}
+
|<code>replace("input", "match", "\")</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOTY0012}}
+
|<code>FOTY0012</code>
 
| An item has no typed value.
 
| An item has no typed value.
|{{Code|}}
+
|<code>count#1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOTY0013}}
+
|<code>FOTY0013</code>
 
| Functions items cannot be atomized, have no defined equality, and have no string representation.
 
| Functions items cannot be atomized, have no defined equality, and have no string representation.
|{{Code|}}
+
|<code>data(false#0)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOTY0014}}
+
|<code>FOTY0014</code>
 
| Function items have no string representation.
 
| Function items have no string representation.
|{{Code|}}
+
|<code>string(map {})</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOTY0015}}
+
|<code>FOTY0015</code>
 
| Function items cannot be compared.
 
| Function items cannot be compared.
|{{Code|}}
+
|<code>deep-equal(false#0, true#0)</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOUT1170}}
+
|<code>FOUT1170</code>
 
| Function argument cannot be used to retrieve a text resource.
 
| Function argument cannot be used to retrieve a text resource.
|{{Code|}}
+
|<code>unparsed-text(':')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOUT1170}}
+
|<code>FOUT1190</code>
 
| Encoding to retrieve a text resource is invalid or not supported.
 
| Encoding to retrieve a text resource is invalid or not supported.
|{{Code|unparsed-text('file.txt', 'InvalidEncoding')}}
+
|<code>unparsed-text('file.txt', 'InvalidEncoding')</code>
 
|}
 
|}
  
....to be added: FOTY0012-0015
+
=Serialization Errors=
 
 
==Serialization Errors==
 
  
Error Codes: {{Code|SEPM}}, {{Code|SERE}}, {{Code|SESU}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|SEPM}}, {{Code|SERE}}, {{Code|SESU}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="50%"|Description
+
! width="50%" |Description
! width="45%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|SESU0007}}
+
|<code>SESU0007</code>
 
| The specified encoding is not supported.
 
| The specified encoding is not supported.
|{{Code|declare option output:encoding "xyz"; 1}}
+
|<code>declare option output:encoding "xyz"; 1</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|SEPM0009}}
+
|<code>SEPM0009</code>
| {{Code|omit-xml-declaration}} is set to {{Code|yes}}, and {{Code|standalone}} has a value other than {{Code|omit}}.
+
|<code>omit-xml-declaration</code> is set to {{Code|yes}}, and {{Code|standalone}} has a value other than {{Code|omit}}.
 
|
 
|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|SEPM0010}}
+
|<code>SEPM0010</code>
| {{Code|method}} is set to {{Code|xml}}, {{Code|undeclare-prefixes}} is set to {{Code|yes}}, and {{Code|version}} is set to {{Code|1.0}}.
+
|<code>method</code> is set to {{Code|xml}}, {{Code|undeclare-prefixes}} is set to {{Code|yes}}, and {{Code|version}} is set to {{Code|1.0}}.
 
|
 
|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|SERE0014}}
+
|<code>SERE0014</code>
| {{Code|method}} is set to {{Code|html}}, and an invalid HTML character is found.
+
|<code>method</code> is set to {{Code|html}}, and an invalid HTML character is found.
 
|
 
|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|SERE0015}}
+
|<code>SERE0015</code>
| {{Code|method}} is set to {{Code|html}}, and a closing bracket (&gt;) appears inside a processing instruction.
+
|<code>method</code> is set to {{Code|html}}, and a closing bracket (&gt;) appears inside a processing instruction.
 
|
 
|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|SEPM0016}}
+
|<code>SEPM0016</code>
 
| A specified parameter is unknown or has an invalid value.
 
| A specified parameter is unknown or has an invalid value.
| {{Code|declare option output:indent "nope"; 1}}
+
|<code>declare option output:indent "nope"; 1</code>
|
 
|- valign="top" scope="row"
 
|{{Code|SEPM0017}}
 
| The definition of serialization parameter is invalid.
 
 
|
 
|
 
|}
 
|}
  
==Update Errors==
+
=Update Errors=
  
Error Codes: {{Code|FOUP}}, {{Code|XUDY}}, {{Code|XUST}}, {{Code|XUTY}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|FOUP}}, {{Code|XUDY}}, {{Code|XUST}}, {{Code|XUTY}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="50%"|Description
+
! width="50%" |Description
! width="45%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOUP0001}}
+
|<code>FOUP0001</code>
 
| The first argument of {{Code|fn:put()}} must be a document node or element.
 
| The first argument of {{Code|fn:put()}} must be a document node or element.
 
|<code>fn:put(text { 1 }, 'file.txt')</code>
 
|<code>fn:put(text { 1 }, 'file.txt')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FOUP0002}}
+
|<code>FOUP0002</code>
 
| The second argument of {{Code|fn:put()}} is not a valid URI.
 
| The second argument of {{Code|fn:put()}} is not a valid URI.
|{{Code|fn:put(<a/>, '//')}}
+
|<code>fn:put(<a/>, '//')</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0009}}
+
|<code>XUDY0009</code>
 
| The target node of a replace expression needs a parent in order to be replaced.
 
| The target node of a replace expression needs a parent in order to be replaced.
|{{Code|replace node <target/> with <new/>}}
+
|<code>replace node <target/> with <new/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0014}}
+
|<code>XUDY0014</code>
 
| The expression updated by the {{Code|modify}} clause was not created by the {{Code|copy}} clause.
 
| The expression updated by the {{Code|modify}} clause was not created by the {{Code|copy}} clause.
|{{Code|let $a := doc('a') return copy $b := $a modify delete node $a/* return $b}}
+
|<code>let $a := doc('a') return copy $b := $a modify delete node $a/* return $b</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0015}}
+
|<code>XUDY0015</code>
 
| In a {{Code|rename}} expression, a target is renamed more than once.
 
| In a {{Code|rename}} expression, a target is renamed more than once.
|{{Code|let $a := <xml/> return (rename node $a as 'a', rename node $a as 'b')}}
+
|<code>let $a := <xml/> return (rename node $a as 'a', rename node $a as 'b')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0016}}
+
|<code>XUDY0016</code>
 
| In a {{Code|replace}} expression, a target is replaced more than once.
 
| In a {{Code|replace}} expression, a target is replaced more than once.
|{{Code|let $a := <x>x</x>/node() return (replace node $a with <a/>, replace node $a with <b/>)}}
+
|<code>let $a := <x>x</x>/node() return (replace node $a with <a/>, replace node $a with <b/>)</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0017}}
+
|<code>XUDY0017</code>
 
| In a {{Code|replace value of}} expression, a target is replaced more than once.
 
| In a {{Code|replace value of}} expression, a target is replaced more than once.
|{{Code|let $a := <x/> return (replace value of node $a with 'a', replace value of node $a with 'a')}}
+
|<code>let $a := <x/> return (replace value of node $a with 'a', replace value of node $a with 'a')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0021}}
+
|<code>XUDY0021</code>
 
| The resulting update expression contains duplicate attributes.
 
| The resulting update expression contains duplicate attributes.
 
|<code>copy $c := <x a='a'/> modify insert node attribute a {""} into $c return $c</code>
 
|<code>copy $c := <x a='a'/> modify insert node attribute a {""} into $c return $c</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0023}}
+
|<code>XUDY0023</code>
 
| The resulting update expression conflicts with existing namespaces.
 
| The resulting update expression conflicts with existing namespaces.
|{{Code|rename node <a:ns xmlns:a='uri'/> as QName('URI', 'a:ns')}}
+
|<code>rename node <a:ns xmlns:a='uri'/> as QName('URI', 'a:ns')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0024}}
+
|<code>XUDY0024</code>
 
| New namespaces conflict with each other.
 
| New namespaces conflict with each other.
 
|<code>copy $n := <x/> modify (insert node attribute { QName('uri1', 'a') } { "" } into $n, insert node attribute { QName('uri2', 'a') } { "" } into $n) return $n</code>
 
|<code>copy $n := <x/> modify (insert node attribute { QName('uri1', 'a') } { "" } into $n, insert node attribute { QName('uri2', 'a') } { "" } into $n) return $n</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0027}}
+
|<code>XUDY0027</code>
 
| Target of an update expression is an empty sequence.
 
| Target of an update expression is an empty sequence.
|{{Code|insert node <x/> into ()}}
+
|<code>insert node <x/> into ()</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0029}}
+
|<code>XUDY0029</code>
 
| The target of an update expression has no parent node.
 
| The target of an update expression has no parent node.
|{{Code|insert node <new/> before <target/>}}
+
|<code>insert node <new/> before <target/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0030}}
+
|<code>XUDY0030</code>
 
| Attributes cannot be inserted before or after the child of a document node.
 
| Attributes cannot be inserted before or after the child of a document node.
 
|<code>insert node <e a='a'/>/@a after document { <e/> }/*</code>
 
|<code>insert node <e a='a'/>/@a after document { <e/> }/*</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUDY0031}}
+
|<code>XUDY0031</code>
 
| Multiple calls to {{Code|fn:put()}} address the same URI.
 
| Multiple calls to {{Code|fn:put()}} address the same URI.
|{{Code|for $i in 1 to 3 return put(<a/>, 'file.txt')}}
+
|<code>for $i in 1 to 3 return put(<a/>, 'file.txt')</code>
 
|-
 
|-
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUST0001}}
+
|<code>XUST0001</code>
 
| No updating expression is allowed here.
 
| No updating expression is allowed here.
|{{Code|delete node /, "finished."}}
+
|<code>delete node /, "finished."</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUST0002}}
+
|<code>XUST0002</code>
 
| An updating expression is expected in the {{Code|modify}} clause or an updating function.
 
| An updating expression is expected in the {{Code|modify}} clause or an updating function.
|{{Code|copy $a := <x/> modify 1 return $a}}
+
|<code>copy $a := <x/> modify 1 return $a</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUST0003}}
+
|<code>XUST0003</code>
 
| The revalidation mode was declared more than once.
 
| The revalidation mode was declared more than once.
|{{Code|declare revalidation ...}}
+
|<code>declare revalidation ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUST0026}}
+
|<code>XUST0026</code>
 
| The query contains a revalidate expression (revalidation is not supported by BaseX).
 
| The query contains a revalidate expression (revalidation is not supported by BaseX).
|{{Code|declare revalidation ...}}
+
|<code>declare revalidation ...</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUST0028}}
+
|<code>XUST0028</code>
 
| no return type may be specified in an updating function.
 
| no return type may be specified in an updating function.
 
|<code>declare updating function local:x() as item() { () }; ()</code>
 
|<code>declare updating function local:x() as item() { () }; ()</code>
Line 667: Line 654:
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0004}}
+
|<code>XUTY0004</code>
 
| New attributes to be inserted must directly follow the root node.
 
| New attributes to be inserted must directly follow the root node.
 
|<code>insert node (<a/>, attribute a {""}) into <a/></code>
 
|<code>insert node (<a/>, attribute a {""}) into <a/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0005}}
+
|<code>XUTY0005</code>
 
| A single element or document node is expected as target of an {{Code|insert}} expression.
 
| A single element or document node is expected as target of an {{Code|insert}} expression.
 
|<code>insert node <new/> into attribute a { "" }</code>
 
|<code>insert node <new/> into attribute a { "" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0006}}
+
|<code>XUTY0006</code>
 
| A single element, text, comment or processing instruction is expected as target of an {{Code|insert before/after}} expression.
 
| A single element, text, comment or processing instruction is expected as target of an {{Code|insert before/after}} expression.
 
|<code>insert node <new/> after attribute a { "" }</code>
 
|<code>insert node <new/> after attribute a { "" }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0007}}
+
|<code>XUTY0007</code>
 
| Only nodes can be deleted.
 
| Only nodes can be deleted.
|{{Code|delete node "string"}}
+
|<code>delete node "string"</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0008}}
+
|<code>XUTY0008</code>
 
| A single element, text, attribute, comment or processing instruction is expected as target of a {{Code|replace}} expression.
 
| A single element, text, attribute, comment or processing instruction is expected as target of a {{Code|replace}} expression.
 
|<code>replace node document { <a/> } with <b/></code>
 
|<code>replace node document { <a/> } with <b/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0010}}
+
|<code>XUTY0010</code>
 
| In a {{Code|replace}} expression, in which no attributes are targeted, the replacing nodes must not be attributes as well.
 
| In a {{Code|replace}} expression, in which no attributes are targeted, the replacing nodes must not be attributes as well.
 
|<code>replace node <a><b/></a>/b with attribute size { 1 }</code>
 
|<code>replace node <a><b/></a>/b with attribute size { 1 }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0011}}
+
|<code>XUTY0011</code>
 
| In the {{Code|replace}} expression, in which attributes are targeted, the replacing nodes must be attributes as well.
 
| In the {{Code|replace}} expression, in which attributes are targeted, the replacing nodes must be attributes as well.
|{{Code|replace node <e a=""/>/@a with <a/>}}
+
|<code>replace node <e a=""/>/@a with <a/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0012}}
+
|<code>XUTY0012</code>
 
| In a {{Code|rename}} expression, the target nodes must be an element, attribute or processing instruction.
 
| In a {{Code|rename}} expression, the target nodes must be an element, attribute or processing instruction.
 
|<code>rename node text { 1 } as <x/></code>
 
|<code>rename node text { 1 } as <x/></code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0013}}
+
|<code>XUTY0013</code>
 
| An expression in the {{Code|copy}} clause must return a single node.
 
| An expression in the {{Code|copy}} clause must return a single node.
|{{Code|copy $c := (<a/>, <b/>) modify () return $c}}
+
|<code>copy $c := (<a/>, <b/>) modify () return $c</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|XUTY0022}}
+
|<code>XUTY0022</code>
 
| An attribute must not be inserted into a document node.
 
| An attribute must not be inserted into a document node.
 
|<code>insert node <e a=""/>/@a into document {'a'}</code>
 
|<code>insert node <e a=""/>/@a into document {'a'}</code>
 
|}
 
|}
  
==Full-Text Errors==
+
=Full-Text Errors=
  
Error Codes: {{Code|FTDY}}, {{Code|FTST}}
+
* Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>
 +
* Namespace prefix: <code>err</code>
 +
* Codes: {{Code|FTDY}}, {{Code|FTST}}
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
! width="5%"|Code
+
! width="110"|Code
! width="50%"|Description
+
! width="50%" |Description
! width="45%"|Examples
+
!Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTDY0016}}
+
|<code>FTDY0016</code>
 
| The specified weight value is out of range.
 
| The specified weight value is out of range.
 
|<code>'a' contains text 'a' weight { 1001 }</code>
 
|<code>'a' contains text 'a' weight { 1001 }</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTDY0017}}
+
|<code>FTDY0017</code>
 
| The {{Code|not in}} operator contains a ''string exclude''.
 
| The {{Code|not in}} operator contains a ''string exclude''.
|{{Code|'a' contains text 'a' not in (ftnot 'a')}}
+
|<code>'a' contains text 'a' not in (ftnot 'a')</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTDY0020}}
+
|<code>FTDY0020</code>
 
| The search term uses an invalid wildcard syntax.
 
| The search term uses an invalid wildcard syntax.
 
|<code>'a' contains text '.{}' using wildcards</code>
 
|<code>'a' contains text '.{}' using wildcards</code>
Line 731: Line 720:
 
| colspan=3 style="background-color:white;"|
 
| colspan=3 style="background-color:white;"|
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTST0007}}
+
|<code>FTST0007</code>
 
| The full-text expression contains an ignore option (the {{Code|ignore option}} is not supported by BaseX).
 
| The full-text expression contains an ignore option (the {{Code|ignore option}} is not supported by BaseX).
|{{Code|'a' contains text 'a' without content 'x'}}
+
|<code>'a' contains text 'a' without content 'x'</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTST0008}}
+
|<code>FTST0008</code>
 
| The specified stop word file could not be opened or processed.
 
| The specified stop word file could not be opened or processed.
|{{Code|'a' contains text 'a' using stop words at 'unknown.txt'}}
+
|<code>'a' contains text 'a' using stop words at 'unknown.txt'</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTST0009}}
+
|<code>FTST0009</code>
 
| The specified language is not supported.
 
| The specified language is not supported.
|{{Code|'a' contains text 'a' using language 'aaa'}}
+
|<code>'a' contains text 'a' using language 'aaa'</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTST0018}}
+
|<code>FTST0018</code>
 
| The specified thesaurus file could not be opened or processed.
 
| The specified thesaurus file could not be opened or processed.
|{{Code|'a' contains text 'a' using thesaurus at 'aaa'}}
+
|<code>'a' contains text 'a' using thesaurus at 'aaa'</code>
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
|{{Code|FTST0019}}
+
|<code>FTST0019</code>
 
| A match option was specified more than once.
 
| A match option was specified more than once.
|{{Code|'a' contains text 'a' using stemming using stemming}}
+
|<code>'a' contains text 'a' using stemming using stemming</code>
 +
|}
 +
 
 +
=BaseX Errors=
 +
 
 +
* Namespace URI: <code><nowiki>http://basex.org</nowiki></code>
 +
* Namespace prefix: <code>basex</code>
 +
 
 +
{| class="wikitable" width="100%"
 +
! width="110"|Code
 +
!Description
 +
!Examples
 +
|- valign="top" scope="row"
 +
|<code>annotation</code>
 +
| Annotation errors.
 +
|<code>%basex:xyz function() { 123 }</code>
 +
|- valign="top" scope="row"
 +
|<code>doc</code>
 +
| The argument specified via fn:doc must yield a single document.
 +
|<code>doc('db-collection')</code>
 +
|- valign="top" scope="row"
 +
|<code>error</code>
 +
| Generic error, which is e. g. raised by [[Java Bindings#Integration|Java bindings]].
 +
|<code>import module namespace qm='java:org.basex.query.func.QueryModuleTest';<br/>qm:error()</code>
 +
|- valign="top" scope="row"
 +
|<code>function</code>
 +
| Function items cannot be cached.
 +
|<code>db:output(true#0)</code>
 +
|- valign="top" scope="row"
 +
|<code>http</code>
 +
| The function was called outside an HTTP servlet context.
 +
|<code>session:get('abc')</code>
 +
|- valign="top" scope="row"
 +
|<code>options</code>
 +
| The specified database option is unknown.
 +
|<code>declare option db:xyz 'no'; 1</code>
 +
|- valign="top" scope="row"
 +
|<code>overflow</code>
 +
| Stack overflow.
 +
|<code>declare function local:a() { local:b() + 1 };<br/>declare function local:b() { local:a() + 2 };<br/>local:a()</code>
 +
|- valign="top" scope="row"
 +
|<code>permission</code>
 +
| The current user has insufficient [[User Management|permissions]] to open a database, update nodes, etc.
 +
|<code>db:open('admin')</code>
 +
|- valign="top" scope="row"
 +
|<code>restxq</code>
 +
| Errors related to [[RESTXQ]].
 +
|<code>%restxq:GET('x')</code>
 +
|- valign="top" scope="row"
 +
|<code>update</code>
 +
| BaseX-specific update errors.
 +
|<code><a/> update db:output('bla')</code>
 
|}
 
|}
  
[[Category:XQuery]]
+
Additional, module-specific error codes are listed in the descriptions of the query modules.

Revision as of 16:06, 22 November 2017

This article is part of the XQuery Portal. It summarizes the codes of errors that are raised by the standard features and functions of XQuery. As the original specifications are pretty comprehensive, we tried our best to make this overview comprehensible to a wider range of readers.

The following tables list the error codes that are known to BaseX, a short description, and examples of queries raising that errors. Errors that are specific to BaseX can be found in the descriptions of the respective modules.

Original definitions of the error codes are found in the XQuery 3.0, XQuery 3.0 Functions, XQuery 1.0 Update, XQuery 1.0 Full Text, and EXPath HTTP Specifications.

Static Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: XPST, XQST
Code Description Examples
XPST0003 An error occurred while parsing the query string (i.e., before the query could be compiled and executed). This error is the most common one, and may be accompanied by a variety of different error messages. 1+
for i in //* return $i
XPST0005 An expression will never return any results, no matter what input is provided. doc('input')/..
XPST0008 A variable or type name is used that has not been defined in the current scope. $a---
element(*, x)
XPST0017 • The specified function is unknown,
• it uses the wrong number of arguments, or, when calling Java functions:
• there is more than one function with the same number of arguments.
unknown()
count(1,2,3)
XPST0051 An unknown QName is used in a sequence type (e.g. in the target type of the cast expression). 1 instance of x
"test" cast as xs:itr
XPST0080 xs:NOTATION or xs:anyAtomicType is used as target type of cast or castable. 1 castable as xs:NOTATION
XPST0081 • A QName uses a prefix that has not been bound to any namespace, or
• a pragma or option declaration has not been prefixed.
unknown:x
(# pragma #) { 1 }
XQST0009 The query imports a schema (schema import is not supported by BaseX). import schema "x"; ()
XQST0022 Namespace values must be constant strings. <elem xmlns="{ 'dynamic' }"/>
XQST0031 The specified XQuery version is not specified. xquery version "9.9"; ()
XQST0032 The base URI was declared more than once. declare base-uri ...
XQST0033 A namespace prefix was declared more than once. declare namespace a="a";
declare namespace a="b"; ()
XQST0034 A function was declared more than once. declare function local:a() { 1 };
declare function local:a() { 2 }; local:a()
XQST0038 The default collation was declared more than once. declare default collation ...
XQST0039 Two or more parameters in a user-defined function have the same name. declare function local:fun($a, $a) { $a * $a };
local:fun(1,2)
XQDY0040 Two or more attributes in an element have the same node name. <elem a="1" a="12"/>
XQDY0045 A user-defined function uses a reserved namespace. declare function fn:fun() { 1 }; ()
XQST0047 A module was defined more than once. import module ...
XQST0048 A module declaration does not match the namespace of the specified module. import module namespace invalid="uri"; 1
XQST0049 A global variable was declared more than once. declare variable $a := 1;
declare variable $a := 1; $a
XQST0054 A global variable depends on itself. This may be triggered by a circular variable definition. declare variable $a := local:a();
declare function local:a() { $a }; $a
XQST0055 The mode for copying namespaces was declared more than once. declare copy-namespaces ...
XQST0057 The namespace of a schema import may not be empty. import schema ""; ()
XQST0059 The schema or module with the specified namespace cannot be found or processed. import module "unknown"; ()
XQST0060 A user-defined function has no namespace. declare default function namespace "";
declare function x() { 1 }; 1
XQST0065 The ordering mode was declared more than once. declare ordering ...
XQST0065 The default namespace mode for elements or functions was declared more than once. declare default element namespace ...
XQST0067 The construction mode was declared more than once. declare construction ...
XQST0068 The mode for handling boundary spaces was declared more than once. declare boundary-space ...
XQST0069 The default order for empty sequences was declared more than once. declare default order empty ...
XQST0070 A namespace declaration overwrites a reserved namespace. declare namespace xml=""; ()
XQST0071 A namespace is declared more than once in an element constructor. <a xmlns="uri1" xmlns="uri2"/>
XQST0075 The query contains a validate expression (validation is not supported by BaseX). validate strict { () }
XQST0076 A group by or order by clause specifies an unknown collation. for $i in 1 to 10
order by $i collation "unknown"
return $i
XQST0079 A pragma was specified without the expression that is to be evaluated. (# xml:a #) {}
XQST0085 An empty namespace URI was specified. <pref:elem xmlns:pref=""/>
XQST0087 An unknown encoding was specified. Note that the encoding declaration is currently ignored in BaseX. xquery version "1.0" encoding "a b"; ()
XQST0088 An empty module namespace was specified. import module ""; ()
XQST0089 Two variables in a for or let clause have the same name. for $a at $a in 1 return $i
XQST0090 A character reference specifies an invalid character. "&#0;"
XQST0093 A module depends on itself. This may be triggered by a circular module definition. import module ...
XQST0094 group by references a variable that has not been declared before. for $a in 1 group by $b return $a
XQST0097 A decimal-format property is invalid. declare default decimal-format digit = "xxx"; 1
XQST0098 A single decimal-format character was assigned to multiple properties. declare default decimal-format digit = "%"; 1
XQST0099 The context item was declared more than once. declare context item ...
XQST0106 An annotation has been declared twice in a variable or function declaration. declare %updating %updating function ...
XQST0108 Output declarations may only be specified in the main module. Module: declare output ...
XQST0109 The specified serialization parameter is unknown. declare option output:unknown "..."; 1
XQST0110 A serialization parameter was specified more than once in the output declarations. declare option output:indent "no";
declare option output:indent "no"; 1
XQST0111 A decimal format was declared more than once. declare decimal-format ...
XQST0113 Context item values may only be in the main module. Module: declare context item := 1;
XQST0114 A decimal-format property has been specified more than once. declare decimal-format EN NaN="!" NaN="?"; ()

Type Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: XPTY, XQTY
Code Description Examples
XPTY0004 This error is raised if an expression has the wrong type, or cannot be cast into the specified type. It may be raised both statically (during query compilation) or dynamically (at runtime). 1 + "A"
abs("a")
1 cast as xs:gYear
XPTY0018 The result of the last step in a path expression contains both nodes and atomic values. doc('input.xml')/(*, 1)
XPTY0019 The result of a step (other than the last step) in a path expression contains an atomic values. (1 to 10)/*
XQTY0024 An attribute node cannot be bound to its parent element, as other nodes of a different type were specified before. <elem>text { attribute a { "val" } }</elem>
XQTY0105 A function item has been specified as content of an element. <X>{ false#0 }</X>

Dynamic Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: XPDY, XQDY
Code Description Examples
XPDY0002 • No value has been defined for an external variable, or
• no context item has been set before the query was executed.
declare variable $x external; $x
descendant::*
XPDY0050 • The operand type of a treat expression does not match the type of the argument, or
• the root of the context item must be a document node.
"string" treat as xs:int
"string"[/]
XQDY0025 Two or more attributes in a constructed element have the same node name. element x { attribute a { "" } attribute a { "" } }
XQDY0026 The content of a computed processing instruction contains "?>". processing-instruction pi { "?>" }
XQDY0041 The name of a processing instruction is invalid. processing-instruction { "1" } { "" }
XQDY0044 The node name of an attribute uses reserved prefixes or namespaces. attribute xmlns { "etc" }
XQDY0064 The name of a processing instruction equals "XML" (case insensitive). processing-instruction xml { "etc" }
XQDY0072 The content of a computed comment contains "--" or ends with "-". comment { "one -- two" }
XQDY0074 The name of a computed attribute or element is invalid, or uses an unbound prefix. element { "x y" } { "" }
XQDY0095 A sequence with more than one item was bound to a group by clause. let $a := (1,2) group by $a return $a
XQDY0096 The node name of an element uses reserved prefixes or namespaces. element { QName("uri", "xml:n") } {}
XQDY0101 Invalid namespace declaration. namespace xmlns { 'x' }
XQDY0102 Duplicate namespace declaration. element x { namespace a {'b'}, namespace a {'c'} }

Functions Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: FOAR, FOCA, FOCH, FODC, FODF, FODT, FOER, FOFD, FONS, FORG, FORX, FOTY, FOUT
Code Description Examples
FOAR0001 A value was divided by zero. 1 div 0
FOAR0002 A numeric declaration or operation causes an over- or underflow. 12345678901234567890
xs:double("-INF") idiv 1
FOCA0002 • A float number cannot be converted to a decimal or integer value, or
• a function argument cannot be converted to a valid QName.
xs:int(xs:double("INF"))
QName("", "el em")
FOCA0003 A value is too large to be represented as integer. xs:integer(99e100)
FOCA0005 "NaN" is supplied to duration operations. xs:yearMonthDuration("P1Y") * xs:double("NaN")
FOCH0001 A codepoint was specified that does not represent a valid XML character. codepoints-to-string(0)
FOCH0002 A unsupported collation was specified in a function. compare('a', 'a', 'unknown')
FOCH0003 A unsupported normalization form was specified in a function. normalize-unicode('a', 'unknown')
FODC0001 The argument specified in fn:id() or fn:idref() must have a document node as root. id("id0", <xml/>)
FODC0002 The specified document resource cannot be retrieved. doc("unknown.xml")
FODC0004 The specified collection cannot be retrieved. collection("unknown")
FODC0005 The specified URI to a document resource is invalid. doc("<xml/>")
FODC0006 The string passed to fn:parse-xml() is not well-formed. parse-xml("<x/")
FODC0007 The base URI passed to fn:parse-xml() is invalid. parse-xml("<x/>", ":")
FODF1280 The name of the decimal format passed to fn:format-number() is invalid. format-number(1, "0", "invalid")
FODF1310 The picture string passed to fn:format-number() is invalid. format-number(1, "invalid")
FODT0001 An arithmetic duration operation causes an over- or underflow. xs:date('2000-01-01') + xs:duration('P99999Y')
FODT0002 A duration declaration or operation causes an over- or underflow. implicit-timezone() div 0
FODT0003 An invalid timezone was specified. adjust-time-to-timezone(xs:time("01:01:01"), xs:dayTimeDuration("PT20H"))
FOER0000 Error triggered by the fn:error() function. error()
FOFD1340 The picture string passed to fn:format-date(), fn:format-time() or fn:format-dateTime() is invalid. format-date(current-date(), "[]")
FOFD1350 The picture string passed to fn:format-date(), fn:format-time() or fn:format-dateTime() specifies an non-available component. format-time(current-time(), "[Y2]")
FONS0004 A function has a QName as argument that specifies an unbound prefix. resolve-QName("x:e", <e/>)
FORG0001 A value cannot be cast to the required target type. xs:integer("A")
1 + <x>a</x>
FORG0002 The URI passed to fn:resolve-URI() is invalid. resolve-URI(":")
FORG0003 fn:zero-or-one() was called with more than one item. zero-or-one((1, 2))
FORG0004 fn:one-or-more() was called with zero items. one-or-more(())
FORG0005 fn:exactly-one() was called with zero or more than one item. exactly-one((1, 2))
FORG0006 A wrong argument type was specified in a function call. sum((1, "string"))
FORG0008 The arguments passed to fn:dateTime() have different timezones. dateTime(xs:date("2001-01-01+01:01"), current-time())
FORX0001 A function specifies an invalid regular expression flag. matches('input', 'query', 'invalid')
FORX0002 A function specifies an invalid regular expression. matches('input', '[')
FORX0003 A regular expression matches an empty string. tokenize('input', '.?')
FORX0004 The replacement string of a regular expression is invalid. replace("input", "match", "\")
FOTY0012 An item has no typed value. count#1
FOTY0013 Functions items cannot be atomized, have no defined equality, and have no string representation. data(false#0)
FOTY0014 Function items have no string representation. string(map {})
FOTY0015 Function items cannot be compared. deep-equal(false#0, true#0)
FOUT1170 Function argument cannot be used to retrieve a text resource. unparsed-text(':')
FOUT1190 Encoding to retrieve a text resource is invalid or not supported. unparsed-text('file.txt', 'InvalidEncoding')

Serialization Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: SEPM, SERE, SESU
Code Description Examples
SESU0007 The specified encoding is not supported. declare option output:encoding "xyz"; 1
SEPM0009 omit-xml-declaration is set to yes, and standalone has a value other than omit.
SEPM0010 method is set to xml, undeclare-prefixes is set to yes, and version is set to 1.0.
SERE0014 method is set to html, and an invalid HTML character is found.
SERE0015 method is set to html, and a closing bracket (>) appears inside a processing instruction.
SEPM0016 A specified parameter is unknown or has an invalid value. declare option output:indent "nope"; 1

Update Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: FOUP, XUDY, XUST, XUTY
Code Description Examples
FOUP0001 The first argument of fn:put() must be a document node or element. fn:put(text { 1 }, 'file.txt')
FOUP0002 The second argument of fn:put() is not a valid URI. fn:put(<a/>, '//')
XUDY0009 The target node of a replace expression needs a parent in order to be replaced. replace node <target/> with <new/>
XUDY0014 The expression updated by the modify clause was not created by the copy clause. let $a := doc('a') return copy $b := $a modify delete node $a/* return $b
XUDY0015 In a rename expression, a target is renamed more than once. let $a := <xml/> return (rename node $a as 'a', rename node $a as 'b')
XUDY0016 In a replace expression, a target is replaced more than once. let $a := <x>x</x>/node() return (replace node $a with <a/>, replace node $a with )
XUDY0017 In a replace value of expression, a target is replaced more than once. let $a := <x/> return (replace value of node $a with 'a', replace value of node $a with 'a')
XUDY0021 The resulting update expression contains duplicate attributes. copy $c := <x a='a'/> modify insert node attribute a {""} into $c return $c
XUDY0023 The resulting update expression conflicts with existing namespaces. rename node <a:ns xmlns:a='uri'/> as QName('URI', 'a:ns')
XUDY0024 New namespaces conflict with each other. copy $n := <x/> modify (insert node attribute { QName('uri1', 'a') } { "" } into $n, insert node attribute { QName('uri2', 'a') } { "" } into $n) return $n
XUDY0027 Target of an update expression is an empty sequence. insert node <x/> into ()
XUDY0029 The target of an update expression has no parent node. insert node <new/> before <target/>
XUDY0030 Attributes cannot be inserted before or after the child of a document node. insert node <e a='a'/>/@a after document { <e/> }/*
XUDY0031 Multiple calls to fn:put() address the same URI. for $i in 1 to 3 return put(<a/>, 'file.txt')
XUST0001 No updating expression is allowed here. delete node /, "finished."
XUST0002 An updating expression is expected in the modify clause or an updating function. copy $a := <x/> modify 1 return $a
XUST0003 The revalidation mode was declared more than once. declare revalidation ...
XUST0026 The query contains a revalidate expression (revalidation is not supported by BaseX). declare revalidation ...
XUST0028 no return type may be specified in an updating function. declare updating function local:x() as item() { () }; ()
XUTY0004 New attributes to be inserted must directly follow the root node. insert node (<a/>, attribute a {""}) into <a/>
XUTY0005 A single element or document node is expected as target of an insert expression. insert node <new/> into attribute a { "" }
XUTY0006 A single element, text, comment or processing instruction is expected as target of an insert before/after expression. insert node <new/> after attribute a { "" }
XUTY0007 Only nodes can be deleted. delete node "string"
XUTY0008 A single element, text, attribute, comment or processing instruction is expected as target of a replace expression. replace node document { <a/> } with
XUTY0010 In a replace expression, in which no attributes are targeted, the replacing nodes must not be attributes as well. replace node <a></a>/b with attribute size { 1 }
XUTY0011 In the replace expression, in which attributes are targeted, the replacing nodes must be attributes as well. replace node <e a=""/>/@a with <a/>
XUTY0012 In a rename expression, the target nodes must be an element, attribute or processing instruction. rename node text { 1 } as <x/>
XUTY0013 An expression in the copy clause must return a single node. copy $c := (<a/>, ) modify () return $c
XUTY0022 An attribute must not be inserted into a document node. insert node <e a=""/>/@a into document {'a'}

Full-Text Errors

  • Namespace URI: http://www.w3.org/2005/xqt-errors
  • Namespace prefix: err
  • Codes: FTDY, FTST
Code Description Examples
FTDY0016 The specified weight value is out of range. 'a' contains text 'a' weight { 1001 }
FTDY0017 The not in operator contains a string exclude. 'a' contains text 'a' not in (ftnot 'a')
FTDY0020 The search term uses an invalid wildcard syntax. 'a' contains text '.{}' using wildcards
FTST0007 The full-text expression contains an ignore option (the ignore option is not supported by BaseX). 'a' contains text 'a' without content 'x'
FTST0008 The specified stop word file could not be opened or processed. 'a' contains text 'a' using stop words at 'unknown.txt'
FTST0009 The specified language is not supported. 'a' contains text 'a' using language 'aaa'
FTST0018 The specified thesaurus file could not be opened or processed. 'a' contains text 'a' using thesaurus at 'aaa'
FTST0019 A match option was specified more than once. 'a' contains text 'a' using stemming using stemming

BaseX Errors

  • Namespace URI: http://basex.org
  • Namespace prefix: basex
Code Description Examples
annotation Annotation errors. %basex:xyz function() { 123 }
doc The argument specified via fn:doc must yield a single document. doc('db-collection')
error Generic error, which is e. g. raised by Java bindings. import module namespace qm='java:org.basex.query.func.QueryModuleTest';
qm:error()
function Function items cannot be cached. db:output(true#0)
http The function was called outside an HTTP servlet context. session:get('abc')
options The specified database option is unknown. declare option db:xyz 'no'; 1
overflow Stack overflow. declare function local:a() { local:b() + 1 };
declare function local:b() { local:a() + 2 };
local:a()
permission The current user has insufficient permissions to open a database, update nodes, etc. db:open('admin')
restxq Errors related to RESTXQ. %restxq:GET('x')
update BaseX-specific update errors. <a/> update db:output('bla')

Additional, module-specific error codes are listed in the descriptions of the query modules.