Difference between revisions of "XQuery Errors"

From BaseX Documentation
Jump to navigation Jump to search
(Created page with "This article is part of the Query Portal. It summarizes all error codes that may be thrown by the BaseX XQuery processor. ==Static Errors== {| class="wikitable" wi...")
 
Line 2: Line 2:
 
It summarizes all error codes that may be thrown by the BaseX XQuery processor.
 
It summarizes all error codes that may be thrown by the BaseX XQuery processor.
  
==Static Errors==
+
As the official specifications are written too formal to be easily
 +
understood, we tried our best to make this article comprehensible
 +
to everyone. The following tables include the error code that is
 +
raised by BaseX, a description, and examples of queries raising
 +
that error.
 +
 
 +
==XPST: Static Errors==
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
!Code
+
! width="5%"|Code
!Description
+
! width="70%"|Description
!Examples
+
! width="25%"|Examples
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
 
|<code>XPST0003</code>
 
|<code>XPST0003</code>
Line 22: Line 28:
 
|- valign="top" scope="row"
 
|- valign="top" scope="row"
 
|<code>XPST0017<br/>&nbsp;</code>
 
|<code>XPST0017<br/>&nbsp;</code>
| The specified function is unknown, or uses the wrong number of arguments (i.e., it does not match the ''name'' and ''arity'' of the existing function signatures).
+
| The specified function is unknown, or<br />• it uses the wrong number of arguments.
|<code>fn:unknown()<hr/>count()</code>
+
|<code>fn:unknown()<hr/>fn:count(1,2,3)</code>
 +
|- valign="top" scope="row"
 +
|<code>XPST0051<br/>&nbsp;</code>
 +
| An unknown QName is used in a ''sequence type'' (e.g. target type of the <code>cast</code> expression).
 +
|<code>1 instance of x<hr/>"test"&nbsp;cast&nbsp;as&nbsp;xs:itr</code>
 +
|- valign="top" scope="row"
 +
|<code>XPST0080<br/>&nbsp;</code>
 +
| <code>xs:NOTATION</code> or <code>xs:anyAtomicType</code> is used as target type of <code>cast</code> or <code>castable</code>.
 +
|<code>1 castable as xs:NOTATION</code>
 +
|- valign="top" scope="row"
 +
|<code>XPST0081<br/>&nbsp;</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.
 +
|<code>unknown:x<hr/>(# pragma #) { 1 }</code>
 
|}
 
|}
 +
 +
In progress...

Revision as of 11:40, 29 January 2011

This article is part of the Query Portal. It summarizes all error codes that may be thrown by the BaseX XQuery processor.

As the official specifications are written too formal to be easily understood, we tried our best to make this article comprehensible to everyone. The following tables include the error code that is raised by BaseX, a description, and examples of queries raising that error.

XPST: Static Errors

Code Description Examples
XPST0003 An error occurred while parsing the query string (i.e., before the query could be compiled and executed). 1+
XPST0005 An expression will never results, no matter what input will be processed. 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, or
• it uses the wrong number of arguments.
fn:unknown()
fn:count(1,2,3)
XPST0051
 
An unknown QName is used in a sequence type (e.g. 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 }

In progress...