error.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2006-2008 The FLWOR Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #ifndef ZORBA_ERROR_API_H
00017 #define ZORBA_ERROR_API_H
00018 
00019 #include <zorba/zorbastring.h>
00020 
00021 namespace zorba {
00022 
00023   /** \brief Helper class that cannot be instantiated. Basically, it contains the definition
00024    *         of all ErrorCodes.
00025    */
00026   class ZorbaError 
00027   {
00028     public:
00029       /** \brief The ErrorCode enum contains all error codes that can be reported by the
00030        *         engine.
00031        *
00032        * Error codes are either the error codes defined by the %XQuery 1.0 or the
00033        * XQuery 1.0 and XPath 2.0 Functions and Operators Specification or error codes
00034        * specifically related to %Zorba.
00035        * Error codes are reported by a ZorbaException that is either thrown or passed
00036        * as parameter to an ErrorHandler.
00037        */
00038       enum ErrorCode
00039       {
00040         //
00041         // XPath dynamic errors
00042         //
00043         XPDY0002 = 1,
00044         // evaluation of an expression relies on some part of the dynamic context
00045         // that has not been assigned a value.
00046 
00047         XPDY0021,
00048         // (Not currently used.)
00049 
00050         XPDY0050,
00051         // the dynamic type of the operand of a treat expression does not match the
00052         // sequence type specified by the treat expression. This error might also
00053         // be raised by a path expression beginning with "/" or "// " if the context
00054         // node is not in a tree that is rooted at a document node. This is because
00055         // a leading "/" or "// " in a path expression is an abbreviation for an
00056         // initial step that includes the clause treat as document-node().
00057 
00058         //
00059         // XPath static errors
00060         //
00061 
00062         XPST0001,
00063         // analysis of an expression relies on some component of the static context
00064         // that has not been assigned a value.
00065 
00066         XPST0003,
00067         // an expression is not a valid instance of the grammar.
00068 
00069         XPST0005,
00070         // During the analysis phase, it is a static error if the static type
00071         // assigned to an expression other than the expression () or data(()) is
00072         // empty-sequence().
00073 
00074         XPST0008,
00075         // an expression refers to an element name, attribute name, schema type
00076         // name, namespace prefix, or variable name that is not defined in the
00077         // static context, except for an ElementName in an ElementTest or an
00078         // AttributeName in an AttributeTest.
00079 
00080         XPST0010,
00081         // An implementation must raise a static error if it encounters a reference
00082         // to an axis that it does not support.
00083 
00084         XPST0017,
00085         // the expanded QName and number of arguments in a function call do not
00086         // match the name and arity of a function signature in the static context.
00087 
00088         XPST0051,
00089         // a QName that is used as an AtomicType in a SequenceType is not defined
00090         // in the in-scope schema types as an atomic type.
00091 
00092         XPST0080,
00093         // the target type of a cast or castable expression is xs:NOTATION or
00094         // xs:anyAtomicType.
00095 
00096         XPST0081,
00097         // a QName used in a query contains a namespace prefix that cannot be
00098         // expanded into a namespace URI by using the statically known namespaces.
00099 
00100         XPST0083,
00101         // (Not currently used.)
00102 
00103         //
00104         // XPath type errors
00105         //
00106 
00107         XPTY0004,
00108         // during the static analysis phase, an expression is found to have a
00109         // static type that is not appropriate for the context in which the
00110         // expression occurs, or during the dynamic evaluation phase, the dynamic
00111         // type of a value does not match a required type as specified by the
00112         // matching rules in 2.5.4,  // SequenceType Matching.
00113 
00114         XPTY0006,
00115         // (Not currently used.)
00116 
00117         XPTY0007,
00118         // (Not currently used.)
00119 
00120         XPTY0018,
00121         // the result of the last step in a path expression contains both nodes
00122         // and atomic values.
00123 
00124         XPTY0019,
00125         // the result of a step (other than the last step) in a path expression
00126         // contains an atomic value.
00127 
00128         XPTY0020,
00129         // in an axis step, the context item is not a node.
00130 
00131         //
00132         // XQuery dynamic errors
00133         //
00134 
00135         XQDY0025,
00136         // any attribute of a constructed element does not have a name that is
00137         // distinct from the names of all other attributes of the constructed
00138         // element.
00139 
00140         XQDY0026,
00141         // a constructor or replace expression results in a processing instruction
00142         // node whose content includes the string "?>".
00143 
00144         XQDY0027,
00145         // In a validate expression, it is a dynamic error if the root element
00146         // information item in the PSVI resulting from validation does not have
00147         // the expected validity property: valid if validation mode is strict,
00148         // or either valid or notKnown if validation mode is lax.
00149 
00150         XQDY0029,
00151         // (Not currently used.)
00152 
00153         XQDY0041,
00154         // the value of the name expression in a computed processing instruction
00155         // constructor cannot be cast to the type xs:NCName.
00156 
00157         XQDY0044,
00158         // the node-name property of the node constructed by a computed attribute
00159         // constructor is in the namespace http:// www.w3.org/2000/xmlns/
00160         // (corresponding to namespace prefix xmlns), or is in no namespace and
00161         // has local name xmlns.
00162 
00163         XQDY0052,
00164         // (Not currently used.)
00165 
00166         XQDY0061,
00167         // the operand of a validate expression is a document node whose children
00168         // do not consist of exactly one element node and zero or more comment and
00169         // processing instruction nodes, in any order.
00170 
00171         XQDY0062,
00172         // (Not currently used.)
00173 
00174         XQDY0064,
00175         // the value of the name expression in a computed processing instruction
00176         // constructor is equal to "XML" (in any combination of upper and lower case).
00177 
00178         XQDY0072,
00179         // a constructor or replace expression results in a comment node whose
00180         // content ends with a hyphen or contains two adjacent hyphens.
00181 
00182         XQDY0074,
00183         // the value of the name expression in a computed element or attribute
00184         // constructor or rename expression cannot be converted to an expanded
00185         // QName (for example, because it contains a namespace prefix not found
00186         // in statically known namespaces.) 
00187 
00188         XQDY0084,
00189         // the element validated by a validate statement does not have a top-level
00190         // element declaration in the in-scope element declarations, if validation
00191         // mode is strict.
00192 
00193         XQDY0091,
00194         // An implementation MAY raise a dynamic error if an xml:id error, as
00195         // defined in [XML ID], is encountered during construction of an attribute
00196         // named xml:id.
00197 
00198         XQDY0092,
00199         // An implementation MAY raise a dynamic error if a constructed attribute
00200         // named xml:space has a value other than preserve or default.
00201 
00202         //
00203         // XQuery static errors
00204         //
00205 
00206         XQST0009,
00207         // An implementation that does not support the Schema Import Feature must
00208         // raise a static error if a Prolog contains a schema import.
00209 
00210         XQST0012,
00211         // the set of definitions contained in all schemas imported by a Prolog do
00212         // not satisfy the conditions for schema validity specified in Sections 3,
00213         //  // and 5,  // of [XML Schema] Part 1--i.e., each definition must be
00214         // valid, complete, and unique.
00215 
00216         XQST0013,
00217         // an implementation recognizes a pragma but determines that its content
00218         // is invalid.
00219 
00220         XQST0014,
00221         // (Not currently used.)
00222 
00223         XQST0015,
00224         // (Not currently used.)
00225 
00226         XQST0016,
00227         // An implementation that does not support the Module Feature raises a
00228         // static error if it encounters a module declaration or a module import.
00229 
00230         XQST0022,
00231         // the value of a namespace declaration attribute is not a URILiteral.
00232 
00233         XQST0031,
00234         // the version number specified in a version declaration is not supported by
00235         // the implementation.
00236 
00237         XQST0032,
00238         // A static error is raised if a Prolog contains more than one base URI
00239         // declaration.
00240 
00241         XQST0033,
00242         // a module contains multiple bindings for the same namespace prefix.
00243 
00244         XQST0034,
00245         // multiple functions declared or imported by a module have the number of
00246         // arguments and their expanded QNames are equal (as defined by the eq
00247         // operator).
00248 
00249         XQST0035,
00250         // It is a static error to import two schema components that both define
00251         // the same name in the same symbol space and in the same scope.
00252 
00253         XQST0036,
00254         // It is a static error to import a module if the importing module's in-scope
00255         // schema types do not include definitions for the schema type names that
00256         // appear in the declarations of variables and functions (whether in an
00257         // argument type or return type) that are present in the imported module and
00258         // are referenced in the importing module.
00259 
00260         XQST0037,
00261         // (Not currently used.)
00262 
00263         XQST0038,
00264         // a Prolog contains more than one default collation declaration, or the 
00265         //value specified by a default collation declaration is not present in
00266         // statically known collations.
00267 
00268         XQST0039,
00269         // It is a static error for a function declaration to have more than one
00270         // parameter with the same name.
00271 
00272         XQST0040,
00273         // the attributes specified by a direct element constructor do not have
00274         // distinct expanded QNames.
00275 
00276         XQST0042,
00277         // (Not currently used.)
00278 
00279         XQST0043,
00280         // (Not currently used.)
00281 
00282         XQST0045,
00283         // the function name in a function declaration is in one of the following
00284         // namespaces:
00285         // http://www.w3.org/XML/1998/namespace,
00286         // http://www.w3.org/2001/XMLSchema,
00287         // http:// www.w3.org/2001/XMLSchema-instance,
00288         // http://www.w3.org/2005/xpath-functions.
00289 
00290         XQST0046,
00291         // An implementation MAY raise a static error if the value of a URILiteral
00292         // is of nonzero length and is not in the lexical space of xs:anyURI.
00293 
00294         XQST0047,
00295         // multiple module imports in the same Prolog specify the same target
00296         // namespace.
00297 
00298         XQST0048,
00299         // a function or variable declared in a library module is not in the
00300         // target namespace of the library module.
00301 
00302         XQST0049,
00303         // two or more variables declared or imported by a module have equal
00304         // expanded QNames (as defined by the eq operator.)
00305 
00306         XQST0053,
00307         // (Not currently used.)
00308 
00309         XQST0054,
00310         // a variable depends on itself.
00311 
00312         XQST0055,
00313         // a Prolog contains more than one copy-namespaces declaration.
00314 
00315         XQST0056,
00316         // (Not currently used.)
00317 
00318         XQST0057,
00319         // a schema import binds a namespace prefix but does not specify a target
00320         // namespace other than a zero-length string.
00321 
00322         XQST0058,
00323         // multiple schema imports specify the same target namespace.
00324 
00325         XQST0059,
00326         // an implementation is unable to process a schema or module import by
00327         // finding a schema or module with the specified target namespace.
00328 
00329         XQST0060,
00330         // the name of a function in a function declaration is not in a namespace
00331         // (expanded QName has a null namespace URI).
00332 
00333         XQST0063,
00334         // (Not currently used.)
00335 
00336         XQST0065,
00337         // A static error is raised if a Prolog contains more than one ordering
00338         // mode declaration.
00339 
00340         XQST0066,
00341         // A static error is raised if a Prolog contains more than one default
00342         // element/type namespace declaration, or more than one default function
00343         // namespace declaration.
00344 
00345         XQST0067,
00346         // A static error is raised if a Prolog contains more than one construction declaration.
00347 
00348         XQST0068,
00349         // A static error is raised if a Prolog contains more than one boundary-space
00350         // declaration.
00351 
00352         XQST0069,
00353         // A static error is raised if a Prolog contains more than one empty order declaration.
00354 
00355         XQST0070,
00356         // A static error is raised if a namespace URI is bound to the predefined
00357         // prefix xmlns, or if a namespace URI other than
00358         // http:// www.w3.org/XML/1998/namespace is bound to the prefix xml, or if
00359         // the prefix xml is bound to a namespace URI other
00360         // than http:// www.w3.org/XML/1998/namespace.
00361 
00362         XQST0071,
00363         // A static error is raised if the namespace declaration attributes of a
00364         // direct element constructor do not have distinct names.
00365 
00366         XQST0073,
00367         // the graph of module imports contains a cycle (that is, if there exists a
00368         // sequence of modules M1,  ... Mn such that each Mi imports Mi+1, and Mn
00369         // imports M1), unless all the modules in the cycle share a common namespace.
00370 
00371         XQST0075,
00372         // An implementation that does not support the Validation Feature must raise
00373         // a static error if it encounters a validate expression.
00374 
00375         XQST0076,
00376         // a collation subclause in an order by clause of a FLWOR expression does
00377         // not identify a collation that is present in statically known collations.
00378 
00379         XQST0077,
00380         // (Not currently used.)
00381 
00382         XQST0078,
00383         // (Not currently used.)
00384 
00385         XQST0079,
00386         // an extension expression contains neither a pragma that is recognized by
00387         // the implementation nor an expression enclosed in curly braces.
00388 
00389         XQST0082,
00390         // (Not currently used.)
00391 
00392         XQST0085,
00393         // the namespace URI in a namespace declaration attribute is a zero-length
00394         // string, and the implementation does not support [XML Names 1.1].
00395 
00396         XQST0087,
00397         // the encoding specified in a Version Declaration does not conform to the
00398         // definition of EncName specified in [XML 1.0].
00399 
00400         XQST0088,
00401         // the literal that specifies the target namespace in a module import or a
00402         // module declaration is of zero length.
00403 
00404         XQST0089,
00405         // a variable bound in a for clause of a FLWOR expression, and its associated
00406         // positional variable, do not have distinct names (expanded QNames).
00407 
00408         XQST0090,
00409         // a character reference does not identify a valid character in the version
00410         // of XML that is in use.
00411 
00412         XQST0093,
00413         // It is a static error to import a module M1,  // if there exists a sequence
00414         // of modules M1, ... Mi ... M1, such that each module directly depends on
00415         // the next module in the sequence (informally, if M1, depends on itself
00416         // through some chain of module dependencies.)
00417 
00418         //
00419         // XQuery Type erros
00420         //
00421 
00422         XQTY0023,
00423         // (Not currently used.)
00424 
00425         XQTY0024,
00426         // the content sequence in an element constructor contains an attribute node
00427         // following a node that is not an attribute node.
00428 
00429         XQTY0028,
00430         // (Not currently used.)
00431 
00432         XQTY0030,
00433         // the argument of a validate expression does not evaluate to exactly one
00434         // document or element node.
00435 
00436         XQTY0086,
00437         // the typed value of a copied element or attribute node is namespace-
00438         // sensitive when construction mode is preserve and copy-namespaces mode
00439         // is no-preserve.
00440 
00441         //
00442         // XQuery Update Facility
00443         //
00444 
00445         XUST0001,
00446         // It is a static error if an updating expression is used in any position
00447         // other than one of the following:
00448         // 1. The topmost expression in the body of a query.
00449         // 2. The modify clause of a transform expression.
00450         // 3. The return clause of a FLWOR expression.
00451         // 4. The return clauses of a typeswitch expression in which every return
00452         //    clause contains an updating expression, an empty expression ( ), or
00453         //    a call to the fn:error function.
00454         // 5. The then and else clauses of a conditional statement in which both
00455         //    the then and else clauses contain either an updating expression, an
00456         //    empty expression ( ), or a call to the fn:error function.
00457         // 6. An operand of a comma expression in which each operand is either an
00458         //    updating expression, an empty expression ( ), or a call to the
00459         //    fn:error function.
00460         // 7. The content of a parenthesized expression.
00461         // 8. The body of a function declaration in which the keyword updating
00462         //    is specified.
00463 
00464         XUST0002,
00465         // It is a static error if an non-updating expression other than an
00466         // empty expression ( ) or a call to the fn:error function is used in
00467         // one of the following positions:
00468         // 1. The modify clause of a transform expression.
00469         // 2. The top-level expression in the body of a function declaration in
00470         //     which the keyword updating is specified.
00471 
00472         XUST0003,
00473         // It is a static error if a Prolog contains more than one revalidation
00474         // declaration.
00475 
00476         XUTY0004,
00477         // It is a type error if the insertion sequence of an insert expression
00478         // contains an attribute node following a node that is not an attribute node.
00479 
00480         XUTY0005,
00481         // In an insert expression where into, as first into, or as last into
00482         // is specified, it is a type error if the target expression returns a
00483         // non-empty result that does not consist of a single element or document
00484         // node.
00485 
00486         XUTY0006,
00487         // In an insert expression where before or after is specified, it is a
00488         // type error if the target expression returns a non-empty result that
00489         // does not consist of a single element, text, comment, or processing
00490         // instruction node.
00491 
00492         XUTY0007,
00493         // It is a type error if the target expression of a delete expression
00494         // does not return a sequence of zero or more nodes.
00495 
00496         XUTY0008,
00497         // In a replace expression, it is a type error if the target expression
00498         // returns a non-empty result that does not consist of a single element,
00499         // attribute, text, comment, or processing instruction node.
00500 
00501         XUDY0009,
00502         // In a replace expression where value of is not specified, it is a
00503         // dynamic error if the node returned by the target expression does not
00504         // have a parent.
00505 
00506         XUTY0010,
00507         // In a replace expression where value of is not specified and the
00508         // target is an element, text, comment, or processing instruction node,
00509         // it is a type error if the replacement sequence does not consist of
00510         // zero or more element, text, comment, or processing instruction nodes.
00511 
00512         XUTY0011,
00513         // In a replace expression where value of is not specified and the target
00514         // is an attribute node, it is a type error if the replacement sequence
00515         // does not consist of zero or more attribute nodes.
00516 
00517         XUTY0012,
00518         // In a rename expression, it is a type error if the target expression
00519         // returns a non-empty result that does not consist of a single element,
00520         // attribute, or processing instruction node.
00521 
00522         XUTY0013,
00523         // In a transform expression, it is a type error if a source expression
00524         // in the copy clause does not return a single node.
00525 
00526         XUDY0014,
00527         // In a transform expression, it is a dynamic error if the modify clause
00528         // modifies any node that was not created by the copy clause.
00529 
00530         XUDY0015,
00531         // It is a dynamic error if any node is the target of more than one
00532         // rename expression within the same query.
00533 
00534         XUDY0016,
00535         // It is a dynamic error if any node is the target of more than one
00536         // replace expression (without value of being specified) within the
00537         // same query.
00538 
00539         XUDY0017,
00540         // It is a dynamic error if any node is the target of more than one
00541         // replace value of expression within the same query.
00542 
00543         XUDY0018,
00544         // It is a dynamic error if a function that was declared to be external
00545         // but not updating returns a non-empty pending update list.
00546 
00547         XUDY0019,
00548         // It is a dynamic error if a function that was declared to be both
00549         // external and updating returns a non-empty data model instance.
00550 
00551         XUDY0020,
00552         // An implementation may (but is not required to) raise a dynamic error
00553         // if a node is deleted that had no parent before execution of the query
00554         // began.
00555 
00556         XUDY0021,
00557         // It is a dynamic error if the XDM instance that would result from
00558         // applying all the updates in a query violates any constraint specified
00559         // in [XQuery/XPath Data Model (XDM)]. In this case, none of the updates
00560         // in the query are made effective.
00561 
00562         XUTY0022,
00563         // It is a type error if an insert expression specifies the insertion
00564         // of an attribute node into a document node.
00565 
00566         XUDY0023,
00567         // It is a dynamic error if an insert, replace, or rename expression
00568         // affects an element node by introducing a new namespace binding that
00569         // conflicts with one of its existing namespace bindings.
00570 
00571         XUDY0024,
00572         // It is a dynamic error if the effect of a set of updating expressions
00573         // is to introduce conflicting namespace bindings into an element node.
00574 
00575         XUDY0025,
00576         // It is a dynamic error if the target of a rename expression is a
00577         // processing instruction node, and the new name expression returns a
00578         // QName with a non-empty namespace prefix.
00579 
00580         XUST0026,
00581         // It is a static error if a revalidation declaration in a Prolog
00582         // specifies a revalidation mode that is not supported by the current
00583         // implementation.
00584 
00585         XUDY0027,
00586         // It is a dynamic error if the target expression of an insert, replace,
00587         // or rename expression evaluates to an empty sequence.
00588 
00589         XUST0028,
00590         // It is a static error if a function declaration specifies both updating
00591         // and a return type.
00592 
00593         XUDY0029,
00594         // In an insert expression where before or after is specified, it is a
00595         // dynamic error if node returned by the target expression does not have
00596         // a parent.
00597         
00598         XUDY0030,
00599         // It is a dynamic error if an insert expression specifies the insertion
00600         // of an attribute node before or after a child of a document node.
00601 
00602         //
00603         // XQuery 1.0 and XPath 2.0 Functions and Operators
00604         //
00605 
00606         FOER0000, //Unidentified error.
00607 
00608         FOAR0001, //Division by zero.  This error is raised whenever an attempt is made to divide by zero.
00609 
00610         FOAR0002, //Numeric operation overflow/underflow.  This error is raised whenever numeric operations result in an overflow or underflow.
00611 
00612         FOCA0001, //Input value too large for decimal.
00613 
00614         FOCA0002, //Invalid lexical value.
00615 
00616         FOCA0003, //Input value too large for integer.
00617 
00618         FOCA0005, //NaN supplied as float/double value.
00619 
00620         FOCA0006, //String to be cast to decimal has too many digits of precision.
00621 
00622         FOCH0001, //Code point not valid.
00623 
00624         FOCH0002, //Unsupported collation.
00625 
00626         FOCH0003, //Unsupported normalization form.
00627 
00628         FOCH0004, //Collation does not support collation units.
00629 
00630         FODC0001, //No context document.
00631 
00632         FODC0002, //Error retrieving resource.
00633 
00634         FODC0003, //Function stability not defined.
00635 
00636         FODC0004, //Invalid argument to fn:collection.
00637 
00638         FODC0005, //Invalid argument to fn:doc or fn:doc-available.
00639 
00640         FODT0001, //Overflow/underflow in date/time operation.
00641 
00642         FODT0002, //Overflow/underflow in duration operation.
00643 
00644         FODT0003, //Invalid timezone value.
00645 
00646         FONS0004, //No namespace found for prefix.
00647 
00648         FONS0005, //Base-uri not defined in the static context.
00649 
00650         FORG0001, //Invalid value for cast/constructor.
00651 
00652         FORG0002, //Invalid argument to fn:resolve-uri().
00653 
00654         FORG0003, //fn:zero-or-one called with a sequence containing more than one item.
00655 
00656         FORG0004, //fn:one-or-more called with a sequence containing no items.
00657 
00658         FORG0005, //fn:exactly-one called with a sequence containing zero or more than one item.
00659 
00660         FORG0006, //Invalid argument type.
00661 
00662         FORG0008, //Both arguments to fn:dateTime have a specified timezone.
00663 
00664         FORG0009, //Error in resolving a relative URI against a base URI in fn:resolve-uri.
00665 
00666         FORX0001, //Invalid regular expression. flags
00667 
00668         FORX0002, //Invalid regular expression.
00669 
00670         FORX0003, //Regular expression matches zero-length string.
00671 
00672         FORX0004, //Invalid replacement string.
00673 
00674         FOTY0012, //Argument node does not have a typed value.
00675 
00676         FOUP0001,
00677         // It is a dynamic error if the first operand of fn:put is not a node of
00678         // a supported kind.
00679 
00680         FOUP0002,
00681         // It is a dynamic error if the second operand of fn:put is not a valid
00682         // lexical representation of the xs:anyURI type.
00683 
00684         //
00685         // Serialization errors
00686         //
00687         SENR0001,
00688         //  It is an error if an item in S6 in sequence normalization is an attribute node or a namespace node.
00689 
00690         SERE0003,
00691         //  It is an error if the serializer is unable to satisfy the rules for 
00692         //  either a well-formed XML document entity or a well-formed XML external 
00693         //  general parsed entity, or both, except for content modified by the 
00694         //  character expansion phase of serialization.
00695 
00696         SEPM0004,
00697         //  It is an error to specify the doctype-system parameter, or to specify 
00698         //  the standalone parameter with a value other than omit, if the instance 
00699         //  of the data model contains text nodes or multiple element nodes as 
00700         //  children of the root node.
00701 
00702         SERE0005,
00703         //  It is an error if the serialized result would contain an NCName Names
00704         //  that contains a character that is not permitted by the version of 
00705         //  Namespaces in XML specified by the version parameter.
00706 
00707         SERE0006,
00708         //  It is an error if the serialized result would contain a character 
00709         //  that is not permitted by the version of XML specified by the version
00710         //  parameter.
00711 
00712         SESU0007,
00713         //  It is an error if an output encoding other than UTF-8 or UTF-16 is requested and the serializer 
00714         //  does not support that encoding.
00715 
00716         SERE0008,
00717         //  It is an error if a character that cannot be represented in the encoding that the serializer is using 
00718         //  for output appears in a context where character references are not allowed (for example if the character
00719         //  occurs in the name of an element).
00720 
00721         SEPM0009,
00722         //  It is an error if the omit-xml-declaration parameter has the value yes, and the standalone attribute 
00723         //  has a value other than omit; or the version parameter has a value other than 1.0 and the doctype-system 
00724         //  parameter is specified.
00725 
00726         SEPM0010,
00727         //  It is an error if the output method is xml, the value of the undeclare-prefixes parameter is yes, and
00728         //  the value of the version parameter is 1.0.
00729 
00730         SESU0011,
00731         //  It is an error if the value of the normalization-form parameter specifies a normalization form that 
00732         //  is not supported by the serializer.
00733 
00734         SERE0012,
00735         //  It is an error if the value of the normalization-form parameter is fully-normalized and any relevant 
00736         //  construct of the result begins with a combining character.
00737 
00738         SESU0013,
00739         //  It is an error if the serializer does not support the version of XML or HTML specified by the version parameter.
00740 
00741         SERE0014,
00742         //  It is an error to use the HTML output method when characters which are legal in XML but not in HTML,
00743         //  specifically the control characters #x7F-#x9F, appear in the instance of the data model.
00744 
00745         SERE0015,
00746         //  It is an error to use the HTML output method when > appears within a processing instruction in the data model
00747         //  instance being serialized.
00748 
00749         SEPM0016,
00750         // It is a an error if a parameter value is invalid for the defined domain.
00751 
00752         //
00753         // ZORBA errors
00754         //
00755         XQP0000_DYNAMIC_RUNTIME_ERROR,
00756         XQP0001_DYNAMIC_ITERATOR_OVERRUN,
00757         XQP0002_DYNAMIC_ILLEGAL_NODE_CHILD,
00758         XQP0003_DYNAMIC_TARGET_NAMESPACE_NOT_FOUND,
00759         XQP0004_SYSTEM_NOT_SUPPORTED,
00760         XQP0005_SYSTEM_ASSERT_FAILED,
00761         XQP0006_SYSTEM_HASH_ERROR_KEYLEN_EXCEEDS_MAXKEYLEN,
00762         XQP0007_SYSTEM_VECTOR_OUT_OF_RANGE,
00763         XQP0008_SYSTEM_READ_LOCK_FAILED,
00764         XQP0009_SYSTEM_WRITE_LOCK_FAILED,
00765         XQP0010_SYSTEM_POP_FROM_EMPTY_LIST,
00766         XQP0011_SYSTEM_FILE_ERROR_IN_FUNCTION,
00767         XQP0012_SYSTEM_FXCHARHEAP_IOEXCEPTION,
00768         XQP0013_SYSTEM_MMFILE_IOEXCEPTION,
00769         XQP0015_SYSTEM_NOT_YET_IMPLEMENTED,
00770         XQP0016_LOADER_IO_ERROR,
00771         XQP0017_LOADER_PARSING_ERROR,
00772         XQP0018_NODEID_ERROR,
00773         XQP0019_INTERNAL_ERROR,
00774         XQP0020_INVALID_URI,
00775         XQP0021_USER_ERROR,
00776         XQP0022_GET_RESULTS_AS_DOM_FAILED,
00777         XQP0023_GET_RESULTS_AS_SAX_FAILED,
00778         XQP0024_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE,
00779 
00780         //
00781         // Zorba API errors
00782         //
00783         API0001_XQUERY_STRING_IS_EMPTY,
00784         API0002_COMPILE_FAILED,
00785         API0003_XQUERY_NOT_COMPILED,
00786         API0004_XQUERY_ALREADY_COMPILED,
00787         API0005_COLLECTION_ALREADY_EXISTS,
00788         API0006_COLLECTION_NOT_FOUND,
00789         API0007_COLLECTION_ITEM_MUST_BE_A_NODE,
00790         API0009_THREAD_NOT_INITIALIZED,
00791         API0010_XQUERY_EXECUTION_NOT_STARTED,
00792         API0011_INVALID_VARIABLE_QNAME,
00793         API0012_INVALID_INDEX,
00794         API0013_INAPPROPRIATE_VARIABLE_VALUE,
00795         API0014_INVALID_ARGUMENT,
00796         API0015_CANNOT_OPEN_FILE,
00797         API0016_CANNOT_CREATE_COLLECTION,
00798         API0017_CANNOT_LOAD_DOCUMENT,
00799         API0018_CANNOT_ACCESS_FILE,
00800         API0019_FUNCTION_ALREADY_REGISTERED,
00801         API0020_DOCUMENT_ALREADY_EXISTS,
00802         API0021_ITEM_TO_LOAD_IS_NOT_NODE,
00803         API0022_QUERY_ALREADY_CLOSED,
00804         API0023_CANNOT_SERIALIZE_UPDATE_QUERY,
00805         API0024_CANNOT_ITERATE_OVER_UPDATE_QUERY,
00806 
00807         MAX_ZORBA_ERROR_CODE
00808       };
00809 
00810       /** \brief Converts the given ErrorCode into a String
00811        *
00812        * @param aErrorCode the ErrorCode to convert into a String
00813        * @return String the ErrorCode as String
00814        */
00815       static String
00816       getErrorCode(ZorbaError::ErrorCode aErrorCode);
00817 
00818     private:
00819       /** \brief Private constructor to prevent from instantiation.
00820        */
00821       ZorbaError();
00822   }; /* class ZorbaError */
00823 
00824 
00825 } /* namespace zorba */
00826 #endif