pub enum Error {
Show 120 variants
StackOverflow,
Unsupported,
UsedQueryWithWrongQueries,
XPST0001,
XPDY0002,
XPST0003,
XPTY0004,
XPST0005,
XPST0008,
XPST0010,
XPST0017,
XPTY0018,
XPTY0019,
XPTY0020,
XQST0039,
XQST0046,
XPDY0050,
XPST0051,
XQST0052,
XQST0070,
XPST0080,
XPST0081,
XPTY0117,
XPDY0130,
XQST0134,
XQDY0137,
FOAP0001,
FOAR0001,
FOAR0002,
FOAY0001,
FOAY0002,
FOCA0001,
FOCA0002,
FOCA0003,
FOCA0005,
FOCA0006,
FOCH0001,
FOCH0002,
FOCH0003,
FOCH0004,
FODC0001,
FODC0002,
FODC0003,
FODC0004,
FODC0005,
FODC0006,
FODC0010,
FODF1280,
FODF1310,
FODT0001,
FODT0002,
FODT0003,
FOER0000,
FOFD1340,
FOFD1350,
FOJS0001,
FOJS0003,
FOJS0004,
FOJS0005,
FOJS0006,
FOJS0007,
FONS0004,
FONS0005,
FOQM0001,
FOQM0002,
FOQM0003,
FOQM0005,
FOQM0006,
FORG0001,
FORG0002,
FORG0003,
FORG0004,
FORG0005,
FORG0006,
FORG0008,
FORG0009,
FORG0010,
FORX0001,
FORX0002,
FORX0003,
FORX0004,
FOTY0012,
FOTY0013,
FOTY0014,
FOTY0015,
FOUT1170,
FOUT1190,
FOUT1200,
FOXT0001,
FOXT0002,
FOXT0003,
FOXT0004,
FOXT0006,
XTSE0630,
XTDE0640,
XTTE3180,
XTDE0450,
SENR0001,
SERE0003,
SEPM0004,
SERE0005,
SERE0006,
SESU0007,
SERE0008,
SEPM0009,
SEPM0010,
SESU0011,
SERE0012,
SESU0013,
SERE0014,
SERE0015,
SEPM0016,
SEPM0017,
SEPM0018,
SEPM0019,
SERE0020,
SERE0021,
SERE0022,
SERE0023,
Application(Box<ApplicationError>),
}
Expand description
XPath/XSLT error code
These are specified by the XPath and XSLT specifications.
Xee extends them with a few additional error codes.
Also known as Error
internally.
Variants§
StackOverflow
Stack overflow.
Internal stack overflow.
Unsupported
Unsupported XPath feature.
This XPath feature is not supported by Xee.
UsedQueryWithWrongQueries
Used query with wrong queries.
The query was created with a different queries collection.
XPST0001
Component absent in static context.
It is a static error if analysis of an expression relies on some component of the static context that is absent.
XPDY0002
Component absent in dynamic context.
It is a dynamic error if evaluation of an expression relies on some part of the dynamic context that is absent.
XPST0003
Parse error.
It is a static error if an expression is not a valid instance of the grammar defined in A.1 EBNF.
XPTY0004
Type error.
It is a type error if, during the static analysis phase, an expression is found to have a static type that is not appropriate for the context in which the expression occurs, or during the dynamic evaluation phase, the dynamic type of a value does not match a required type as specified by the matching rules in 2.5.5 SequenceType Matching.
XPST0005
Empty Sequence type error.
During the analysis phase, it is a static error if the static type
assigned to an expression other than the expression ()
or data(())
is empty-sequence()
.
XPST0008
Name not defined.
It is a static error if an expression refers to an element name, attribute name, schema type name, namespace prefix, or variable name that is not defined in the static context, except for an ElementName in an ElementTest or an AttributeName in an AttributeTest.
XPST0010
Namespace axis not supported.
An implementation that does not support the namespace axis must raise a static error if it encounters a reference to the namespace axis and XPath 1.0 compatibility mode is false.
XPST0017
Type error: incorrect function name or number of arguments.
It is a static error if the expanded QName and number of arguments in a static function call do not match the name and arity of a function signature in the static context.
XPTY0018
Type error: inconsistent sequence.
It is a type error if the result of a path operator contains both nodes and non-nodes.
XPTY0019
Type error: path operator must be applied to node sequence
It is a type error if E1 in a path expression E1/E2 does not evaluate to a sequence of nodes.
XPTY0020
Type error: context item is not a node in an axis step.
It is a type error if, in an axis step, the context item is not a node.
XQST0039
Multiple parameters with same name.
It is a static error for an inline function expression to have more than one parameter with the same name.
XQST0046
Invalid Braced URI Literal.
An implementation MAY raise a static error if the value of a BracedURILiteral is of nonzero length and is neither an absolute URI nor a relative URI.
XPDY0050
Treat type does not match sequence type.
It is a dynamic error if the dynamic type of the operand of a treat
expression does not match the sequence type specified by the treat
expression. This error might also be raised by a path expression
beginning with “/” or “//” if the context node is not in a tree that is
rooted at a document node. This is because a leading “/” or “//” in a
path expression is an abbreviation for an initial step that includes
the clause treat as document-node()
.
XPST0051
Undefined type reference
It is a static error if the expanded QName for an AtomicOrUnionType in a SequenceType is not defined in the in-scope schema types as a generalized atomic type.
XQST0052
Invalid type named in cast or castable expression.
The type named in a cast or castable expression must be the name of a type defined in the in-scope schema types, and the type must be simple.
XQST0070
Illegal prefix
A static error is raised if any of the following conditions is statically detected in any expression:
- The prefix xml is bound to some namespace URI other than
http://www.w3.org/XML/1998/namespace
. - A prefix other than xml is bound to the namespace URI
http://www.w3.org/XML/1998/namespace
. - The prefix xmlns is bound to any namespace URI.
- A prefix other than xmlns is bound to the namespace URI
http://www.w3.org/2000/xmlns/
.
XPST0080
Invalid target type of cast or castable expression.
It is a static error if the target type of a cast or castable expression is xs:NOTATION, xs:anySimpleType, or xs:anyAtomicType.
XPST0081
Unknown namespace prefix.
It is a static error if a QName used in an expression contains a namespace prefix that cannot be expanded into a namespace URI by using the statically known namespaces.
XPTY0117
Type error: namespace-sensitive type expected.
When applying the function conversion rules, if an item is of type xs:untypedAtomic and the expected type is namespace-sensitive, a type error is raised.
XPDY0130
Implementation-dependent limit exceeded.
An implementation-dependent limit has been exceeded.
XQST0134
Namespace axis not supported.
The namespace axis is not supported.
XQDY0137
Duplicate key values in a map.
No two keys in a map may have the same key value.
FOAP0001
Wrong number of arguments.
Raised when fn:apply is called and the arity of the supplied function is not the same as the number of members in the supplied array.
FOAR0001
Division by zero.
This error is raised whenever an attempt is made to divide by zero.
FOAR0002
Numeric operation overflow/underflow.
This error is raised whenever numeric operations result in an overflow or underflow.
FOAY0001
Array index out of bounds.
This error is raised when an integer used to select a member of an array is outside the range of values for that array.
FOAY0002
Negative array length.
This error is raised when the $length argument to array:subarray is negative.
FOCA0001
Input value too large for decimal.
Raised when casting to xs:decimal if the supplied value exceeds the implementation-defined limits for the datatype.
FOCA0002
Invalid lexical value.
Raised by fn:resolve-QName and fn:QName when a supplied value does not have the lexical form of a QName or URI respectively; and when casting to decimal, if the supplied value is NaN or Infinity.
FOCA0003
Input too large for integer.
Raised when casting to xs:integer if the supplied value exceeds the implementation-defined limits for the datatype.
FOCA0005
NaN supplied as float/double value.
Raised when multiplying or dividing a duration by a number, if the number supplied is NaN.
FOCA0006
String to be cast to decimal has too many digits of precision.
Raised when casting a string to xs:decimal if the string has more digits of precision than the implementation can represent (the implementation also has the option of rounding).
FOCH0001
Codepoint not valid.
Raised by fn:codepoints-to-string if the input contains an integer that is not the codepoint of a valid XML character.
FOCH0002
Unsupported collation.
Raised by any function that uses a collation if the requested collation is not recognized.
FOCH0003
Unsupported normalization form.
Raised by fn:normalize-unicode if the requested normalization form is not supported by the implementation.
FOCH0004
Collation does not support collation units.
Raised by functions such as fn:contains if the requested collation does not operate on a character-by-character basis.
FODC0001
No context document.
Raised by fn:id, fn:idref, and fn:element-with-id if the node that identifies the tree to be searched is a node in a tree whose root is not a document node.
FODC0002
Error retrieving resource.
Raised by fn:doc, fn:collection, and fn:uri-collection to indicate that either the supplied URI cannot be dereferenced to obtain a resource, or the resource that is returned is not parseable as XML.
FODC0003
Function not defined as deterministic.
Raised by fn:doc, fn:collection, and fn:uri-collection to indicate that it is not possible to return a result that is guaranteed deterministic.
FODC0004
Invalid collection URI.
Raised by fn:collection and fn:uri-collection if the argument is not a valid xs:anyURI.
FODC0005
Invalid argument to fn:doc or fn:doc-available.
Raised (optionally) by fn:doc and fn:doc-available if the argument is not a valid URI reference.
FODC0006
String passed to fn:parse-xml is not a well-formed XML document.
Raised by fn:parse-xml if the supplied string is not a well-formed and namespace-well-formed XML document; or if DTD validation is requested and the document is not valid against its DTD.
FODC0010
The processor does not support serialization.
Raised when fn:serialize is called and the processor does not support serialization, in cases where the host language makes serialization an optional feature.
FODF1280
Invalid decimal format name.
This error is raised if the decimal format name supplied to fn:format-number is not a valid QName, or if the prefix in the QName is undeclared, or if there is no decimal format in the static context with a matching name.
FODF1310
Invalid decimal format picture string.
This error is raised if the picture string supplied to fn:format-number or fn:format-integer has invalid syntax.
FODT0001
Overflow/underflow in date/time operation.
Raised when casting to date/time datatypes, or performing arithmetic with date/time values, if arithmetic overflow or underflow occurs.
FODT0002
err:FODT0002, Overflow/underflow in duration operation.
Raised when casting to duration datatypes, or performing arithmetic with duration values, if arithmetic overflow or underflow occurs.
FODT0003
Invalid timezone value.
Raised by adjust-date-to-timezone and related functions if the supplied timezone is invalid.
FOER0000
Unidentified error.
Error code used by fn:error when no other error code is provided.
FOFD1340
Invalid date/time formatting parameters.
This error is raised if the picture string or calendar supplied to fn:format-date, fn:format-time, or fn:format-dateTime has invalid syntax.
FOFD1350
Invalid date/time formatting component.
This error is raised if the picture string supplied to fn:format-date selects a component that is not present in a date, or if the picture string supplied to fn:format-time selects a component that is not present in a time.
FOJS0001
JSON syntax error.
Raised by functions such as fn:json-doc, fn:parse-json or fn:json-to-xml if the string supplied as input does not conform to the JSON grammar (optionally with implementation-defined extensions).
FOJS0003
JSON duplicate keys.
Raised by functions such as map:merge, fn:json-doc, fn:parse-json or fn:json-to-xml if the input contains duplicate keys, when the chosen policy is to reject duplicates.
FOJS0004
JSON: not schema-aware.
Raised by fn:json-to-xml if validation is requested when the processor does not support schema validation or typed nodes.
FOJS0005
Invalid options.
Raised by functions such as map:merge, fn:parse-json, and fn:xml-to-json if the $options map contains an invalid entry.
FOJS0006
Invalid XML representation of JSON.
Raised by fn:xml-to-json if the XML input does not conform to the rules for the XML representation of JSON.
FOJS0007
Bad JSON escape sequence.
Raised by fn:xml-to-json if the XML input uses the attribute escaped=“true” or escaped-key=“true”, and the corresponding string or key contains an invalid JSON escape sequence.
FONS0004
No namespace found for prefix.
Raised by fn:resolve-QName and analogous functions if a supplied QName has a prefix that has no binding to a namespace.
FONS0005
Base-uri not defined in the static context.
Raised by fn:resolve-uri if no base URI is available for resolving a relative URI.
FOQM0001
Module URI is a zero-length string.
Raised by fn:load-xquery-module if the supplied module URI is zero-length.
FOQM0002
Module URI not found.
Raised by fn:load-xquery-module if no module can be found with the supplied module URI.
FOQM0003
Static error in dynamically-loaded XQuery module.
Raised by fn:load-xquery-module if a static error (including a statically-detected type error) is encountered when processing the library module.
FOQM0005
Parameter for dynamically-loaded XQuery module has incorrect type.
Raised by fn:load-xquery-module if a value is supplied for the initial context item or for an external variable, and the value does not conform to the required type declared in the dynamically loaded module.
FOQM0006
No suitable XQuery processor available.
Raised by fn:load-xquery-module if no XQuery processor is available supporting the requested XQuery version (or if none is available at all).
FORG0001
Invalid value for cast/constructor.
A general-purpose error raised when casting, if a cast between two datatypes is allowed in principle, but the supplied value cannot be converted: for example when attempting to cast the string “nine” to an integer.
FORG0002
Invalid argument to fn:resolve-uri().
Raised when either argument to fn:resolve-uri is not a valid URI/IRI.
FORG0003
fn:zero-or-one called with a sequence containing more than one item.
Raised by fn:zero-or-one if the supplied value contains more than one item.
FORG0004
fn:one-or-more called with a sequence containing no items.
Raised by fn:one-or-more if the supplied value is an empty sequence.
FORG0005
fn:exactly-one called with a sequence containing zero or more than one item.
Raised by fn:exactly-one if the supplied value is not a singleton sequence.
FORG0006
Invalid argument type.
Raised by functions such as fn:max, fn:min, fn:avg, fn:sum if the supplied sequence contains values inappropriate to this function.
FORG0008
The two arguments to fn:dateTime have inconsistent timezones.
Raised by fn:dateTime if the two arguments both have timezones and the timezones are different.
FORG0009
Error in resolving a relative URI against a base URI in fn:resolve-uri.
A catch-all error for fn:resolve-uri, recognizing that the implementation can choose between a variety of algorithms and that some of these may fail for a variety of reasons.
FORG0010
Invalid date/time.
Raised when the input to fn:parse-ietf-date does not match the prescribed grammar, or when it represents an invalid date/time such as 31 February.
FORX0001
Invalid regular expression flags.
Raised by regular expression functions such as fn:matches and fn:replace if the regular expression flags contain a character other than i, m, q, s, or x.
FORX0002
Invalid regular expression.
Raised by regular expression functions such as fn:matches and fn:replace if the regular expression is syntactically invalid.
FORX0003
Regular expression matches zero-length string.
For functions such as fn:replace and fn:tokenize, raises an error if the supplied regular expression is capable of matching a zero length string.
FORX0004
Invalid replacement string.
Raised by fn:replace to report errors in the replacement string.
FOTY0012
Argument to fn:data() contains a node that does not have a typed value.
Raised by fn:data, or by implicit atomization, if applied to a node with no typed value, the main example being an element validated against a complex type that defines it to have element-only content.
FOTY0013
The argument to fn:data() contains a function item.
Raised by fn:data, or by implicit atomization, if the sequence to be atomized contains a function item.
FOTY0014
The argument to fn:string() is a function item.
Raised by fn:string, or by implicit string conversion, if the input sequence contains a function item.
FOTY0015
An argument to fn:deep-equal() contains a function item.
Raised by fn:deep-equal if either input sequence contains a function item.
FOUT1170
Invalid $href argument to fn:unparsed-text() (etc.)
A dynamic error is raised if the $href argument contains a fragment identifier, or if it cannot be used to retrieve a resource containing text.
FOUT1190
Cannot decode resource retrieved by fn:unparsed-text() (etc.)
A dynamic error is raised if the retrieved resource contains octets that cannot be decoded into Unicode ·characters· using the specified encoding, or if the resulting characters are not permitted XML characters. This includes the case where the processor does not support the requested encoding.
FOUT1200
Cannot infer encoding of resource retrieved by fn:unparsed-text() (etc.)
A dynamic error is raised if $encoding is absent and the processor cannot infer the encoding using external information and the encoding is not UTF-8.
FOXT0001
No suitable XSLT processor available
A dynamic error is raised if no XSLT processor suitable for evaluating a call on fn:transform is available.
FOXT0002
Invalid parameters to XSLT transformation
A dynamic error is raised if the parameters supplied to fn:transform are invalid, for example if two mutually-exclusive parameters are supplied. If a suitable XSLT error code is available (for example in the case where the requested initial-template does not exist in the stylesheet), that error code should be used in preference.
FOXT0003
XSLT transformation failed
A dynamic error is raised if an XSLT transformation invoked using fn:transform fails with a static or dynamic error. The XSLT error code is used if available; this error code provides a fallback when no XSLT error code is returned, for example because the processor is an XSLT 1.0 processor.
FOXT0004
XSLT transformation has been disabled
A dynamic error is raised if the fn:transform function is invoked when XSLT transformation (or a specific transformation option) has been disabled for security or other reasons.
FOXT0006
XSLT output contains non-accepted characters
A dynamic error is raised if the result of the fn:transform function contains characters available only in XML 1.1 and the calling processor cannot handle such characters.
XTSE0630
Duplicate global variable name.
It is a static error if a package contains more than one non-hidden binding of a global variable with the same name and same import precedence, unless it also contains another binding with the same name and higher import precedence.
XTDE0640
Circularity
Circularity in global declarations is now allowed.
XTTE3180
Shallow copy
Shallow copy of sequence of more than one item is not allowed.
XTDE0450
Function item in complex content
The result sequence to be added as content cannot contain a function item.
SENR0001
Function cannot be normalized for serialization.
It is an error if an item in S in sequence normalization is an attribute node or a namespace node.
SERE0003
Entity serialization error
The serializer is unable to satisfy the rules for either a well-formed XML document entity or a well-formed XML external general parsed entity, or both, except for content modified by the character expansion phase of serialization.
SEPM0004
Standalone or doctype-system parameter disallowed for XML fragment.
It’s not allowed to specify the doctype-system parameter, or to specify the standalone parameter with a value other than omit, if the instance of the data model contains text nodes or multiple element nodes as children of the root node.
SERE0005
Invalid character in NCName according to namespaces version.
It is an error if the serialized result would contain an NCNameNames that contains a character that is not permitted by the version of Namespaces in XML specified by the version parameter.
SERE0006
Invalid character according to XML version
It is an error if the serialized result would contain a character that is not permitted by the version of XML specified by the version parameter.
SESU0007
Invalid encoding
It is an error if an output encoding other than UTF-8 or UTF-16 is requested and the serializer does not support that encoding.
SERE0008
Illegal character for encoding
It is an error if a character that cannot be represented in the encoding that the serializer is using for output appears in a context where character references are not allowed (for example if the character occurs in the name of an element).
SEPM0009
standalone even though XML declaration is omitted
It is an error if the omit-xml-declaration parameter has the value yes, true or 1, and the standalone attribute has a value other than omit; or the version parameter has a value other than 1.0 and the doctype-system parameter is specified.
SEPM0010
undeclare-prefixes is not allowed in XML version 1.0
It is an error if the output method is xml or xhtml, the value of the undeclare-prefixes parameter is one of, yes, true or 1, and the value of the version parameter is 1.0.
SESU0011
Unsupported normalization form
It is an error if the value of the normalization-form parameter specifies a normalization form that is not supported by the serializer.
SERE0012
Combining character at start of fully-normalized result
It is an error if the value of the normalization-form parameter is fully-normalized and any relevant construct of the result begins with a combining character.
SESU0013
Unsupported version
It is an error if the serializer does not support the version of XML or HTML specified by the version parameter.
SERE0014
Illegal characters in HTML output.
It is an error to use the HTML output method if characters which are permitted in XML but not in HTML appear in the instance of the data model.
SERE0015
Illegal characters in processing instruction for HTML output.
It is an error to use the HTML output method when > appears within a processing instruction in the data model instance being serialized.
SEPM0016
Parameter value is invalid for the defined domain.
SEPM0017
Error evaluating serialization parameter expression.
It is an error if evaluating an expression in order to extract the setting of a serialization parameter from a data model instance would yield an error.
SEPM0018
Multiple values for use-character-maps serialization parameter.
It is an error if evaluating an expression in order to extract the setting of the use-character-maps serialization parameter from a data model instance would yield a sequence of length greater than one.
SEPM0019
Multiple values for serialization parameter.
It is an error if an instance of the data model used to specify the settings of serialization parameters specifies the value of the same parameter more than once.
SERE0020
Invalid numeric value in JSON.
It is an error if a numeric value being serialized using the JSON output method cannot be represented in the JSON grammar (e.g. +INF, -INF, NaN).
SERE0021
Item not allowed in JSON output.
It is an error if a sequence being serialized using the JSON output method includes items for which no rules are provided in the appropriate section of the serialization rules.
SERE0022
Duplicate key in JSON output.
It is an error if a map being serialized using the JSON output method has two keys with the same string value, unless the allow-duplicate-names has the value yes, true or 1.
SERE0023
Sequence of length greater than one in JSON output.
It is an error if a sequence being serialized using the JSON output method is of length greater than one.
Application(Box<ApplicationError>)
An application generated error
Implementations§
Source§impl Error
impl Error
pub fn with_span(self, span: SourceSpan) -> SpannedError
pub fn with_ast_span(self, span: Span) -> SpannedError
pub fn code(&self) -> String
pub fn code_qname(&self) -> OwnedName
pub fn message(&self) -> &str
pub fn note(&self) -> &str
Trait Implementations§
Source§impl EnumMessage for Error
impl EnumMessage for Error
fn get_message(&self) -> Option<&'static str>
fn get_detailed_message(&self) -> Option<&'static str>
Source§fn get_documentation(&self) -> Option<&'static str>
fn get_documentation(&self) -> Option<&'static str>
fn get_serializations(&self) -> &'static [&'static str]
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for SpannedError
impl From<Error> for SpannedError
Source§impl From<OutOfBoundsError> for Error
impl From<OutOfBoundsError> for Error
Source§fn from(_e: OutOfBoundsError) -> Self
fn from(_e: OutOfBoundsError) -> Self
Source§impl From<ParserError> for Error
impl From<ParserError> for Error
Source§fn from(e: ParserError) -> Self
fn from(e: ParserError) -> Self
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.