1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
52 #ifndef Patternist_ReportContext_H
53 #define Patternist_ReportContext_H
55 #include <QSharedData>
56 #include <QAbstractUriResolver>
57 #include <QSourceLocation>
59 #include "qnamepool_p.h"
66 class QAbstractMessageHandler;
67 class QSourceLocation;
72 class SourceLocationReflection;
75 * @short A callback for reporting errors.
77 * ReportContext receives messages of various severity and type via its
78 * functions warning() and error(). In turn, ReportContext create Message instances
79 * and submit them to the QAbstractMessageHandler instance returned by messageHandler().
81 * The Message attributes are set as follows:
83 * - Message::description() - A translated, human-readable description
84 * - Message::type() - Message::Error if a static, dynamic or type error was encountered
85 * that halted compilation or evaluation, or Message::Warning in case of a warning
86 * - Message::identifier() - This is a URI consisting of the error namespace with the
87 * error code as fragment. For example, a Message representing a syntax error
88 * would return the type "http://www.w3.org/2005/xqt-errors#XPST0003". The convenience
89 * function codeFromURI() can be used to extract the error code. The error namespace
90 * is typically the namespace for XPath and XQuery errors(as in the previous example), but
91 * can also be user defined.
93 * @see <a href="http://www.w3.org/TR/xpath20/#id-identifying-errors">XML Path Language
94 * (XPath) 2.0, 2.3.2 Identifying and Reporting Errors</a>
95 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-error">XQuery 1.0 and
96 * XPath 2.0 Functions and Operators, 3 The Error Function</a>
97 * @author Frans Englich <frans.englich@nokia.com>
98 * @warning This file is auto-generated from extractErrorCodes.xsl. Any
99 * modifications done to this file are lost.
101 class Q_AUTOTEST_EXPORT ReportContext : public QSharedData
104 typedef QHash<const SourceLocationReflection *, QSourceLocation> LocationHash;
107 * A smart pointer wrapping ReportContext instances.
109 typedef QExplicitlySharedDataPointer<ReportContext> Ptr;
112 * @short Default constructors.
114 * For some reason GCC fails to synthesize it, so we provide an empty
117 inline ReportContext() {}
119 virtual ~ReportContext();
122 * Error codes that corresponds to the error codes defined in the
123 * relevant specifications. They are used throughout the API for
124 * identifying error conditions.
126 * While strings could have been used for identifying errors, enums
127 * reduces bugs by providing type safety.
129 * @see <a href="http://www.w3.org/TR/xpath20/#errors">XML
130 * Path Language (XPath) 2.0, 2.3 Error Handling</a>
131 * @see <a href="http://www.w3.org/TR/xpath-functions/#d1e10985">XQuery 1.0
132 * and XPath 2.0 Functions and Operators, C Error Summary</a>
133 * @see <a href="http://www.w3.org/TR/xslt20/#error-summary">XSL Transformations
134 * (XSLT) Version 2.0, E Summary of Error Conditions (Non-Normative)</a>
135 * @note The enumerator values' Doxygen documentation is copied from the
137 * <a href="http://www.w3.org/TR/xpath-functions">XQuery 1.0 and XPath
138 * 2.0 Functions and Operators</a>,
139 * <a href="http://www.w3.org/TR/xpath20">XML Path Language (XPath) 2.0</a>, and
140 * <a href="http://www.w3.org/TR/xslt20/">XSL Transformations (XSLT)
141 * Version 2.0</a>, respectively. The doxygen documentation is therefore covered
142 * by the following legal notice:
143 * "Copyright @ 2005 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
144 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
145 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
146 * <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document
147 * use</a> rules apply."
148 * @warning This enumerator is auto-generated from the relevant specifications
149 * by the XSL-T stylesheet extractErrorCodes.xsl. Hence, any modifications
150 * done to this file, in contrary to the stylesheet, are therefore lost.
155 * XML Schema error code.
160 * It is a static error if analysis of an expression relies on some
161 * component of the static context that has not been assigned a
167 * It is a dynamic error if evaluation of an expression relies on
168 * some part of the dynamic context that has not been assigned a
174 * It is a static error if an expression is not a valid instance
175 * of the grammar defined in A.1 EBNF.
180 * It is a type error if, during the static analysis phase, an expression
181 * is found to have a static type that is not appropriate for the
182 * context in which the expression occurs, or during the dynamic
183 * evaluation phase, the dynamic type of a value does not match
184 * a required type as specified by the matching rules in 2.5.4 SequenceType
190 * During the analysis phase, it is a static error if the static
191 * type assigned to an expression other than the expression () or
192 * data(()) is empty-sequence().
197 * (Not currently used.)
202 * (Not currently used.)
207 * It is a static error if an expression refers to an element name,
208 * attribute name, schema type name, namespace prefix, or variable
209 * name that is not defined in the static context, except for an
210 * ElementName in an ElementTest or an AttributeName in an AttributeTest.
215 * An implementation that does not support the Schema Import Feature
216 * must raise a static error if a Prolog contains a schema import.
221 * An implementation must raise a static error if it encounters
222 * a reference to an axis that it does not support.
227 * It is a static error if the set of definitions contained in all
228 * schemas imported by a Prolog do not satisfy the conditions for
229 * schema validity specified in Sections 3 and 5 of [XML Schema]
230 * Part 1--i.e., each definition must be valid, complete, and unique.
235 * It is a static error if an implementation recognizes a pragma
236 * but determines that its content is invalid.
241 * (Not currently used.)
246 * (Not currently used.)
251 * An implementation that does not support the Module Feature raises
252 * a static error if it encounters a module declaration or a module
258 * It is a static error if the expanded QName and number of arguments
259 * in a function call do not match the name and arity of a function
260 * signature in the static context.
265 * It is a type error if the result of the last step in a path expression
266 * contains both nodes and atomic values.
271 * It is a type error if the result of a step (other than the last
272 * step) in a path expression contains an atomic value.
277 * It is a type error if, in an axis step, the context item is not
283 * (Not currently used.)
288 * It is a static error if the value of a namespace declaration
289 * attribute is not a URILiteral.
294 * (Not currently used.)
299 * It is a type error if the content sequence in an element constructor
300 * contains an attribute node following a node that is not an attribute
306 * It is a dynamic error if any attribute of a constructed element
307 * does not have a name that is distinct from the names of all other
308 * attributes of the constructed element.
313 * It is a dynamic error if the result of the content expression
314 * of a computed processing instruction constructor contains the
320 * In a validate expression, it is a dynamic error if the root element
321 * information item in the PSVI resulting from validation does not
322 * have the expected validity property: valid if validation mode
323 * is strict, or either valid or notKnown if validation mode is
329 * (Not currently used.)
334 * (Not currently used.)
339 * It is a type error if the argument of a validate expression does
340 * not evaluate to exactly one document or element node.
345 * It is a static error if the version number specified in a version
346 * declaration is not supported by the implementation.
351 * A static error is raised if a Prolog contains more than one base
357 * It is a static error if a module contains multiple bindings for
358 * the same namespace prefix.
363 * It is a static error if multiple functions declared or imported
364 * by a module have the number of arguments and their expanded QNames
365 * are equal (as defined by the eq operator).
370 * It is a static error to import two schema components that both
371 * define the same name in the same symbol space and in the same
377 * It is a static error to import a module if the importing module's
378 * in-scope schema types do not include definitions for the schema
379 * type names that appear in the declarations of variables and functions
380 * (whether in an argument type or return type) that are present
381 * in the imported module and are referenced in the importing module.
386 * (Not currently used.)
391 * It is a static error if a Prolog contains more than one default
392 * collation declaration, or the value specified by a default collation
393 * declaration is not present in statically known collations.
398 * It is a static error for a function declaration to have more
399 * than one parameter with the same name.
404 * It is a static error if the attributes specified by a direct
405 * element constructor do not have distinct expanded QNames.
410 * It is a dynamic error if the value of the name expression in
411 * a computed processing instruction constructor cannot be cast
412 * to the type xs:NCName.
417 * (Not currently used.)
422 * (Not currently used.)
427 * It is a dynamic error if the node-name property of the node constructed
428 * by a computed attribute constructor is in the namespace http://www.w3.org/2000/xmlns/
429 * (corresponding to namespace prefix xmlns), or is in no namespace
430 * and has local name xmlns.
435 * It is a static error if the function name in a function declaration
436 * is in one of the following namespaces: http://www.w3.org/XML/1998/namespace,
437 * http://www.w3.org/2001/XMLSchema, http://www.w3.org/2001/XMLSchema-instance,
438 * http://www.w3.org/2005/xpath-functions.
443 * An implementation MAY raise a static error if the value of a
444 * URILiteral is of nonzero length and is not in the lexical space
450 * It is a static error if multiple module imports in the same Prolog
451 * specify the same target namespace.
456 * It is a static error if a function or variable declared in a
457 * library module is not in the target namespace of the library
463 * It is a static error if two or more variables declared or imported
464 * by a module have equal expanded QNames (as defined by the eq
470 * It is a dynamic error if the dynamic type of the operand of a
471 * treat expression does not match the sequence type specified by
472 * the treat expression. This error might also be raised by a path
473 * expression beginning with "/" or "//" if the context node is
474 * not in a tree that is rooted at a document node. This is because
475 * a leading "/" or "//" in a path expression is an abbreviation
476 * for an initial step that includes the clause treat as document-node().
481 * It is a static error if a QName that is used as an AtomicType
482 * in a SequenceType is not defined in the in-scope schema types
488 * (Not currently used.)
493 * (Not currently used.)
498 * It is a static error if a variable depends on itself.
503 * It is a static error if a Prolog contains more than one copy-namespaces
509 * (Not currently used.)
514 * It is a static error if a schema import binds a namespace prefix
515 * but does not specify a target namespace other than a zero-length
521 * It is a static error if multiple schema imports specify the same
527 * It is a static error if an implementation is unable to process
528 * a schema or module import by finding a schema or module with
529 * the specified target namespace.
534 * It is a static error if the name of a function in a function
535 * declaration is not in a namespace (expanded QName has a null
541 * It is a dynamic error if the operand of a validate expression
542 * is a document node whose children do not consist of exactly one
543 * element node and zero or more comment and processing instruction
544 * nodes, in any order.
549 * (Not currently used.)
554 * (Not currently used.)
559 * It is a dynamic error if the value of the name expression in
560 * a computed processing instruction constructor is equal to "XML"
561 * (in any combination of upper and lower case).
566 * A static error is raised if a Prolog contains more than one ordering
572 * A static error is raised if a Prolog contains more than one default
573 * element/type namespace declaration, or more than one default
574 * function namespace declaration.
579 * A static error is raised if a Prolog contains more than one construction
585 * A static error is raised if a Prolog contains more than one boundary-space
591 * A static error is raised if a Prolog contains more than one empty
597 * A static error is raised if a namespace URI is bound to the predefined
598 * prefix xmlns, or if a namespace URI other than http://www.w3.org/XML/1998/namespace
599 * is bound to the prefix xml, or if the prefix xml is bound to
600 * a namespace URI other than http://www.w3.org/XML/1998/namespace.
605 * A static error is raised if the namespace declaration attributes
606 * of a direct element constructor do not have distinct names.
611 * It is a dynamic error if the result of the content expression
612 * of a computed comment constructor contains two adjacent hyphens
613 * or ends with a hyphen.
618 * It is a static error if the graph of module imports contains
619 * a cycle (that is, if there exists a sequence of modules M1 ...
620 * Mn such that each Mi imports Mi+1 and Mn imports M1), unless
621 * all the modules in the cycle share a common namespace.
626 * It is a dynamic error if the value of the name expression in
627 * a computed element or attribute constructor cannot be converted
628 * to an expanded QName (for example, because it contains a namespace
629 * prefix not found in statically known namespaces.)
634 * An implementation that does not support the Validation Feature
635 * must raise a static error if it encounters a validate expression.
640 * It is a static error if a collation subclause in an order by
641 * clause of a FLWOR expression does not identify a collation that
642 * is present in statically known collations.
647 * (Not currently used.)
652 * (Not currently used.)
657 * It is a static error if an extension expression contains neither
658 * a pragma that is recognized by the implementation nor an expression
659 * enclosed in curly braces.
664 * It is a static error if the target type of a cast or castable
665 * expression is xs:NOTATION or xs:anyAtomicType.
670 * It is a static error if a QName used in a query contains a namespace
671 * prefix that cannot be expanded into a namespace URI by using
672 * the statically known namespaces.
677 * (Not currently used.)
682 * (Not currently used.)
687 * It is a dynamic error if the element validated by a validate
688 * statement does not have a top-level element declaration in the
689 * in-scope element declarations, if validation mode is strict.
694 * It is a static error if the namespace URI in a namespace declaration
695 * attribute is a zero-length string, and the implementation does
696 * not support [XML Names 1.1].
701 * It is a type error if the typed value of a copied element or
702 * attribute node is namespace-sensitive when construction mode
703 * is preserve and copy-namespaces mode is no-preserve.
708 * It is a static error if the encoding specified in a Version Declaration
709 * does not conform to the definition of EncName specified in [XML
715 * It is a static error if the literal that specifies the target
716 * namespace in a module import or a module declaration is of zero
722 * It is a static error if a variable bound in a for clause of a
723 * FLWOR expression, and its associated positional variable, do
724 * not have distinct names (expanded QNames).
729 * It is a static error if a character reference does not identify
730 * a valid character in the version of XML that is in use.
735 * An implementation MAY raise a dynamic error if an xml:id error,
736 * as defined in [XML ID], is encountered during construction of
737 * an attribute named xml:id.
742 * An implementation MAY raise a dynamic error if a constructed
743 * attribute named xml:space has a value other than preserve or
749 * It is a static error to import a module M1 if there exists a
750 * sequence of modules M1 ... Mi ... M1 such that each module directly
751 * depends on the next module in the sequence (informally, if M1
752 * depends on itself through some chain of module dependencies.)
757 * Unidentified error.
767 * Numeric operation overflow/underflow.
772 * Input value too large for decimal.
777 * Invalid lexical value.
782 * Input value too large for integer.
787 * NaN supplied as float/double value.
792 * String to be cast to decimal has too many digits of precision.
797 * Code point not valid.
802 * Unsupported collation.
807 * Unsupported normalization form.
812 * Collation does not support collation units.
817 * No context document.
822 * Error retrieving resource.
827 * Function stability not defined.
832 * Invalid argument to fn:collection.
837 * Invalid argument to fn:doc or fn:doc-available.
842 * Overflow/underflow in date/time operation.
847 * Overflow/underflow in duration operation.
852 * Invalid timezone value.
857 * No namespace found for prefix.
862 * Base-uri not defined in the static context.
867 * Invalid value for cast/constructor.
872 * Invalid argument to fn:resolve-uri().
877 * fn:zero-or-one called with a sequence containing more than one
883 * fn:one-or-more called with a sequence containing no items.
888 * fn:exactly-one called with a sequence containing zero or more
894 * Invalid argument type.
899 * Both arguments to fn:dateTime have a specified timezone.
904 * Error in resolving a relative URI against a base URI in fn:resolve-uri.
909 * Invalid regular expression. flags
914 * Invalid regular expression.
919 * Regular expression matches zero-length string.
924 * Invalid replacement string.
929 * Argument node does not have a typed value.
934 * It is an error if an item in S6 in sequence normalization is
935 * an attribute node or a namespace node.
940 * It is an error if the serializer is unable to satisfy the rules
941 * for either a well-formed XML document entity or a well-formed
942 * XML external general parsed entity, or both, except for content
943 * modified by the character expansion phase of serialization.
948 * It is an error to specify the doctype-system parameter, or to
949 * specify the standalone parameter with a value other than omit,
950 * if the instance of the data model contains text nodes or multiple
951 * element nodes as children of the root node.
956 * It is an error if the serialized result would contain an NCName
957 * Names that contains a character that is not permitted by the
958 * version of Namespaces in XML specified by the version parameter.
963 * It is an error if the serialized result would contain a character
964 * that is not permitted by the version of XML specified by the
970 * It is an error if an output encoding other than UTF-8 or UTF-16
971 * is requested and the serializer does not support that encoding.
976 * It is an error if a character that cannot be represented in the
977 * encoding that the serializer is using for output appears in a
978 * context where character references are not allowed (for example
979 * if the character occurs in the name of an element).
984 * It is an error if the omit-xml-declaration parameter has the
985 * value yes, and the standalone attribute has a value other than
986 * omit; or the version parameter has a value other than 1.0 and
987 * the doctype-system parameter is specified.
992 * It is an error if the output method is xml, the value of the
993 * undeclare-prefixes parameter is yes, and the value of the version
999 * It is an error if the value of the normalization-form parameter
1000 * specifies a normalization form that is not supported by the serializer.
1005 * It is an error if the value of the normalization-form parameter
1006 * is fully-normalized and any relevant construct of the result
1007 * begins with a combining character.
1012 * It is an error if the serializer does not support the version
1013 * of XML or HTML specified by the version parameter.
1018 * It is an error to use the HTML output method when characters
1019 * which are legal in XML but not in HTML, specifically the control
1020 * characters \#x7F-#x9F, appear in the instance of the data model.
1025 * It is an error to use the HTML output method when > appears within
1026 * a processing instruction in the data model instance being serialized.
1031 * It is a an error if a parameter value is invalid for the defined
1037 * A static error is signaled if an XSLT-defined element is used
1038 * in a context where it is not permitted, if a required attribute
1039 * is omitted, or if the content of the element does not correspond
1040 * to the content that is allowed for the element.
1045 * It is a static error if an attribute (other than an attribute
1046 * written using curly brackets in a position where an attribute
1047 * value template is permitted) contains a value that is not one
1048 * of the permitted values for that attribute.
1053 * It is a static error to use a reserved namespace in the name
1054 * of a named template, a mode, an attribute set, a key, a decimal-format,
1055 * a variable or parameter, a stylesheet function, a named output
1056 * definition, or a character map.
1061 * It is a static error for an element from the XSLT namespace to
1062 * have an attribute whose namespace is either null (that is, an
1063 * attribute with an unprefixed name) or the XSLT namespace, other
1064 * than attributes defined for the element in this document.
1069 * The value of the version attribute must be a number: specifically,
1070 * it must be a a valid instance of the type xs:decimal as defined
1071 * in [XML Schema Part 2].
1076 * An xsl:stylesheet element must not have any text node children.
1081 * It is a static error if the value of an [xsl:]default-collation
1082 * attribute, after resolving against the base URI, contains no
1083 * URI that the implementation recognizes as a collation URI.
1088 * It is a static error if the xsl:stylesheet element has a child
1089 * element whose name has a null namespace URI.
1094 * A literal result element that is used as the outermost element
1095 * of a simplified stylesheet module must have an xsl:version attribute.
1100 * It is a static error if the processor is not able to retrieve
1101 * the resource identified by the URI reference [ in the href attribute
1102 * of xsl:include or xsl:import] , or if the resource that is retrieved
1103 * does not contain a stylesheet module conforming to this specification.
1108 * An xsl:include element must be a top-level element.
1113 * It is a static error if a stylesheet module directly or indirectly
1119 * An xsl:import element must be a top-level element.
1124 * The xsl:import element children must precede all other element
1125 * children of an xsl:stylesheet element, including any xsl:include
1126 * element children and any user-defined data elements.
1131 * It is a static error if a stylesheet module directly or indirectly
1137 * It is a static error if an xsl:import-schema element that contains
1138 * an xs:schema element has a schema-location attribute, or if it
1139 * has a namespace attribute that conflicts with the target namespace
1140 * of the contained schema.
1145 * It is a static error if the synthetic schema document does not
1146 * satisfy the constraints described in [XML Schema Part 1] (section
1147 * 5.1, Errors in Schema Construction and Structure). This includes,
1148 * without loss of generality, conflicts such as multiple definitions
1154 * Within an XSLT element that is required to be empty, any content
1155 * other than comments or processing instructions, including any
1156 * whitespace text node preserved using the xml:space="preserve"
1157 * attribute, is a static error.
1162 * It is a static error if there is a stylesheet module in the stylesheet
1163 * that specifies input-type-annotations="strip" and another stylesheet
1164 * module that specifies input-type-annotations="preserve".
1169 * In the case of a prefixed QName used as the value of an attribute
1170 * in the stylesheet, or appearing within an XPath expression in
1171 * the stylesheet, it is a static error if the defining element
1172 * has no namespace node whose name matches the prefix of the QName.
1177 * Where an attribute is defined to contain a pattern, it is a static
1178 * error if the pattern does not match the production Pattern.
1183 * It is a static error if an unescaped left curly bracket appears
1184 * in a fixed part of an attribute value template without a matching
1185 * right curly bracket.
1190 * It is a static error if an unescaped right curly bracket occurs
1191 * in a fixed part of an attribute value template.
1196 * An xsl:template element must have either a match attribute or
1197 * a name attribute, or both. An xsl:template element that has no
1198 * match attribute must have no mode attribute and no priority attribute.
1203 * The value of this attribute [the priority attribute of the xsl:template
1204 * element] must conform to the rules for the xs:decimal type defined
1205 * in [XML Schema Part 2]. Negative values are permitted..
1210 * It is a static error if the list [of modes in the mode attribute
1211 * of xsl:template] is empty, if the same token is included more
1212 * than once in the list, if the list contains an invalid token,
1213 * or if the token \#all appears together with any other value.
1218 * It is a static error if two parameters of a template or of a
1219 * stylesheet function have the same name.
1224 * It is a static error if a variable-binding element has a select
1225 * attribute and has non-empty content.
1230 * It is a static error if a stylesheet contains more than one binding
1231 * of a global variable with the same name and same import precedence,
1232 * unless it also contains another binding with the same name and
1233 * higher import precedence.
1238 * It is a static error if a stylesheet contains an xsl:call-template
1239 * instruction whose name attribute does not match the name attribute
1240 * of any xsl:template in the stylesheet.
1245 * It is a static error if a stylesheet contains more than one template
1246 * with the same name and the same import precedence, unless it
1247 * also contains a template with the same name and higher import
1253 * It is a static error if a single xsl:call-template, xsl:apply-templates,
1254 * xsl:apply-imports, or xsl:next-match element contains two or
1255 * more xsl:with-param elements with matching name attributes.
1260 * In the case of xsl:call-template, it is a static error to pass
1261 * a non-tunnel parameter named x to a template that does not have
1262 * a template parameter named x, unless backwards compatible behavior
1263 * is enabled for the xsl:call-template instruction.
1268 * It is a static error if a template that is invoked using xsl:call-template
1269 * declares a template parameter specifying required="yes" and not
1270 * specifying tunnel="yes", if no value for this parameter is supplied
1271 * by the calling instruction.
1276 * It is a static error if the value of the use-attribute-sets attribute
1277 * of an xsl:copy, xsl:element, or xsl:attribute-set element, or
1278 * the xsl:use-attribute-sets attribute of a literal result element,
1279 * is not a whitespace-separated sequence of QNames, or if it contains
1280 * a QName that does not match the name attribute of any xsl:attribute-set
1281 * declaration in the stylesheet.
1286 * It is a static error if an xsl:attribute-set element directly
1287 * or indirectly references itself via the names contained in the
1288 * use-attribute-sets attribute.
1293 * A stylesheet function must have a prefixed name, to remove any
1294 * risk of a clash with a function in the default function namespace.
1295 * It is a static error if the name has no prefix.
1300 * Because arguments to a stylesheet function call must all be specified,
1301 * the xsl:param elements within an xsl:function element must not
1302 * specify a default value: this means they must be empty, and must
1303 * not have a select attribute.
1308 * It is a static error for a stylesheet to contain two or more
1309 * functions with the same expanded-QName, the same arity, and the
1310 * same import precedence, unless there is another function with
1311 * the same expanded-QName and arity, and a higher import precedence.
1316 * It is a static error if an attribute on a literal result element
1317 * is in the XSLT namespace, unless it is one of the attributes
1318 * explicitly defined in this specification.
1323 * It is a static error if a namespace prefix is used within the
1324 * [xsl:]exclude-result-prefixes attribute and there is no namespace
1325 * binding in scope for that prefix.
1330 * It is a static error if the value \#default is used within the
1331 * [xsl:]exclude-result-prefixes attribute and the parent element
1332 * of the [xsl:]exclude-result-prefixes attribute has no default
1338 * It is a static error if there is more than one such declaration
1339 * [more than one xsl:namespace-alias declaration] with the same
1340 * literal namespace URI and the same import precedence and different
1341 * values for the target namespace URI, unless there is also an
1342 * xsl:namespace-alias declaration with the same literal namespace
1343 * URI and a higher import precedence.
1348 * It is a static error if a value other than \#default is specified
1349 * for either the stylesheet-prefix or the result-prefix attributes
1350 * of the xsl:namespace-alias element when there is no in-scope
1351 * binding for that namespace prefix.
1356 * It is a static error if the select attribute of the xsl:attribute
1357 * element is present unless the element has empty content.
1362 * It is a static error if the select attribute of the xsl:value-of
1363 * element is present when the content of the element is non-empty,
1364 * or if the select attribute is absent when the content is empty.
1369 * It is a static error if the select attribute of the xsl:processing-instruction
1370 * element is present unless the element has empty content.
1375 * It is a static error if the select attribute of the xsl:namespace
1376 * element is present when the element has content other than one
1377 * or more xsl:fallback instructions, or if the select attribute
1378 * is absent when the element has empty content.
1383 * It is a static error if the select attribute of the xsl:comment
1384 * element is present unless the element has empty content.
1389 * It is a type error to use the xsl:copy or xsl:copy-of instruction
1390 * to copy a node that has namespace-sensitive content if the copy-namespaces
1391 * attribute has the value no and its explicit or implicit validation
1392 * attribute has the value preserve. It is also a type error if
1393 * either of these instructions (with validation="preserve") is
1394 * used to copy an attribute having namespace-sensitive content,
1395 * unless the parent element is also copied. A node has namespace-sensitive
1396 * content if its typed value contains an item of type xs:QName
1397 * or xs:NOTATION or a type derived therefrom. The reason this is
1398 * an error is because the validity of the content depends on the
1399 * namespace context being preserved.
1404 * It is a static error if the value attribute of xsl:number is
1405 * present unless the select, level, count, and from attributes
1411 * It is a static error if an xsl:sort element with a select attribute
1412 * has non-empty content.
1417 * It is a static error if an xsl:sort element other than the first
1418 * in a sequence of sibling xsl:sort elements has a stable attribute.
1423 * It is a static error if an xsl:perform-sort instruction with
1424 * a select attribute has any content other than xsl:sort and xsl:fallback
1430 * It is a static error if the current-group function is used within
1436 * It is a static error if the current-grouping-key function is
1437 * used within a pattern.
1442 * These four attributes [the group-by, group-adjacent, group-starting-with,
1443 * and group-ending-with attributes of xsl:for-each-group ] are
1444 * mutually exclusive: it is a static error if none of these four
1445 * attributes is present, or if more than one of them is present.
1450 * It is an error to specify the collation attribute if neither
1451 * the group-by attribute nor group-adjacent attribute is specified.
1456 * It is a static error if the xsl:analyze-string instruction contains
1457 * neither an xsl:matching-substring nor an xsl:non-matching-substring
1463 * It is a static error if an xsl:key declaration has a use attribute
1464 * and has non-empty content, or if it has empty content and no
1470 * It is a static error if the xsl:key declaration has a collation
1471 * attribute whose value (after resolving against the base URI)
1472 * is not a URI recognized by the implementation as referring to
1478 * It is a static error if there are several xsl:key declarations
1479 * in the stylesheet with the same key name and different effective
1480 * collations. Two collations are the same if their URIs are equal
1481 * under the rules for comparing xs:anyURI values, or if the implementation
1482 * can determine that they are different URIs referring to the same
1488 * It is a static error if a named or unnamed decimal format contains
1489 * two conflicting values for the same attribute in different xsl:decimal-format
1490 * declarations having the same import precedence, unless there
1491 * is another definition of the same attribute with higher import
1497 * It is a static error if the character specified in the zero-digit
1498 * attribute is not a digit or is a digit that does not have the
1499 * numeric value zero.
1504 * It is a static error if, for any named or unnamed decimal format,
1505 * the variables representing characters used in a picture string
1506 * do not each have distinct values. These variables are decimal-separator-sign,
1507 * grouping-sign, percent-sign, per-mille-sign, digit-zero-sign,
1508 * digit-sign, and pattern-separator-sign.
1513 * It is a static error if there is no namespace bound to the prefix
1514 * on the element bearing the [xsl:]extension-element-prefixes attribute
1515 * or, when \#default is specified, if there is no default namespace.
1520 * It is a static error if both the [xsl:]type and [xsl:]validation
1521 * attributes are present on the xsl:element, xsl:attribute, xsl:copy,
1522 * xsl:copy-of, xsl:document, or xsl:result-document instructions,
1523 * or on a literal result element.
1528 * It is a static error if the value of the type attribute of an
1529 * xsl:element, xsl:attribute, xsl:copy, xsl:copy-of, xsl:document,
1530 * or xsl:result-document instruction, or the xsl:type attribute
1531 * of a literal result element, is not a valid QName, or if it uses
1532 * a prefix that is not defined in an in-scope namespace declaration,
1533 * or if the QName is not the name of a type definition included
1534 * in the in-scope schema components for the stylesheet.
1539 * It is a static error if the value of the type attribute of an
1540 * xsl:attribute instruction refers to a complex type definition
1545 * It is a static error if two xsl:output declarations within an
1546 * output definition specify explicit values for the same attribute
1547 * (other than cdata-section-elements and use-character-maps), with
1548 * the values of the attributes being not equal, unless there is
1549 * another xsl:output declaration within the same output definition
1550 * that has higher import precedence and that specifies an explicit
1551 * value for the same attribute.
1556 * The value [of the method attribute on xsl:output ] must (if present)
1557 * be a valid QName. If the QName does not have a prefix, then it
1558 * identifies a method specified in [XSLT and XQuery Serialization]
1559 * and must be one of xml, html, xhtml, or text.
1564 * It is a static error if the stylesheet contains two or more character
1565 * maps with the same name and the same import precedence, unless
1566 * it also contains another character map with the same name and
1567 * higher import precedence.
1572 * It is a static error if a name in the use-character-maps attribute
1573 * of the xsl:output or xsl:character-map elements does not match
1574 * the name attribute of any xsl:character-map in the stylesheet.
1579 * It is a static error if a character map references itself, directly
1580 * or indirectly, via a name in the use-character-maps attribute.
1585 * A basic XSLT processor must signal a static error if the stylesheet
1586 * includes an xsl:import-schema declaration.
1591 * A basic XSLT processor must signal a static error if the stylesheet
1592 * includes an [xsl:]type attribute, or an [xsl:]validation or default-validation
1593 * attribute with a value other than strip.
1598 * It is a type error if the result of evaluating the sequence constructor
1599 * cannot be converted to the required type.
1604 * It is a type error if an xsl:apply-templates instruction with
1605 * no select attribute is evaluated when the context item is not
1611 * It is a type error if the sequence returned by the select expression
1612 * [of xsl:apply-templates] contains an item that is not a node.
1617 * It is a type error if the supplied value of a variable cannot
1618 * be converted to the required type.
1623 * It is a type error if the conversion of the supplied value of
1624 * a parameter to its required type fails.
1629 * If a default value is given explicitly, that is, if there is
1630 * either a select attribute or a non-empty sequence constructor,
1631 * then it is a type error if the default value cannot be converted
1632 * to the required type, using the function conversion rules.
1637 * If the as attribute [of xsl:function ] is specified, then the
1638 * result evaluated by the sequence constructor (see 5.7 Sequence
1639 * Constructors) is converted to the required type, using the function
1640 * conversion rules. It is a type error if this conversion fails.
1645 * If the value of a parameter to a stylesheet function cannot be
1646 * converted to the required type, a type error is signaled.
1651 * It is a type error if the xsl:number instruction is evaluated,
1652 * with no value or select attribute, when the context item is not
1658 * It is a type error if the result of evaluating the select attribute
1659 * of the xsl:number instruction is anything other than a single
1665 * If any sort key value, after atomization and any type conversion
1666 * required by the data-type attribute, is a sequence containing
1667 * more than one item, then the effect depends on whether the xsl:sort
1668 * element is evaluated with backwards compatible behavior. With
1669 * backwards compatible behavior, the effective sort key value is
1670 * the first item in the sequence. In other cases, this is a type
1676 * It is a type error if the grouping key evaluated using the group-adjacent
1677 * attribute is an empty sequence, or a sequence containing more
1683 * When the group-starting-with or group-ending-with attribute [of
1684 * the xsl:for-each-group instruction] is used, it is a type error
1685 * if the result of evaluating the select expression contains an
1686 * item that is not a node.
1691 * If the validation attribute of an xsl:element, xsl:attribute,
1692 * xsl:copy, xsl:copy-of, or xsl:result-document instruction, or
1693 * the xsl:validation attribute of a literal result element, has
1694 * the effective value strict, and schema validity assessment concludes
1695 * that the validity of the element or attribute is invalid or unknown,
1696 * a type error occurs. As with other type errors, the error may
1697 * be signaled statically if it can be detected statically.
1702 * If the validation attribute of an xsl:element, xsl:attribute,
1703 * xsl:copy, xsl:copy-of, or xsl:result-document instruction, or
1704 * the xsl:validation attribute of a literal result element, has
1705 * the effective value strict, and there is no matching top-level
1706 * declaration in the schema, then a type error occurs. As with
1707 * other type errors, the error may be signaled statically if it
1708 * can be detected statically.
1713 * If the validation attribute of an xsl:element, xsl:attribute,
1714 * xsl:copy, xsl:copy-of, or xsl:result-document instruction, or
1715 * the xsl:validation attribute of a literal result element, has
1716 * the effective value lax, and schema validity assessment concludes
1717 * that the element or attribute is invalid, a type error occurs.
1718 * As with other type errors, the error may be signaled statically
1719 * if it can be detected statically.
1724 * It is a type error if an [xsl:]type attribute is defined for
1725 * a constructed element or attribute, and the outcome of schema
1726 * validity assessment against that type is that the validity property
1727 * of that element or attribute information item is other than valid.
1732 * A type error occurs if a type or validation attribute is defined
1733 * (explicitly or implicitly) for an instruction that constructs
1734 * a new attribute node, if the effect of this is to cause the attribute
1735 * value to be validated against a type that is derived from, or
1736 * constructed by list or union from, the primitive types xs:QName
1742 * A type error occurs [when a document node is validated] unless
1743 * the children of the document node comprise exactly one element
1744 * node, no text nodes, and zero or more comment and processing
1745 * instruction nodes, in any order.
1750 * It is a type error if, when validating a document node, document-level
1751 * constraints are not satisfied. These constraints include identity
1752 * constraints (xs:unique, xs:key, and xs:keyref) and ID/IDREF constraints.
1757 * It is a non-recoverable dynamic error if the effective value
1758 * of an attribute written using curly brackets, in a position where
1759 * an attribute value template is permitted, is a value that is
1760 * not one of the permitted values for that attribute. If the processor
1761 * is able to detect the error statically (for example, when any
1762 * XPath expressions within the curly brackets can be evaluated
1763 * statically), then the processor may optionally signal this as
1769 * It is a non-recoverable dynamic error if the invocation of the
1770 * stylesheet specifies a template name that does not match the
1771 * expanded-QName of a named template defined in the stylesheet.
1776 * It is a non-recoverable dynamic error if the invocation of the
1777 * stylesheet specifies an initial mode (other than the default
1778 * mode) that does not match the expanded-QName in the mode attribute
1779 * of any template defined in the stylesheet.
1784 * It is a non-recoverable dynamic error if the invocation of the
1785 * stylesheet specifies both an initial mode and an initial template.
1790 * It is a non-recoverable dynamic error if the stylesheet that
1791 * is invoked declares a visible stylesheet parameter with required="yes"
1792 * and no value for this parameter is supplied during the invocation
1793 * of the stylesheet. A stylesheet parameter is visible if it is
1794 * not masked by another global variable or parameter with the same
1795 * name and higher import precedence.
1800 * It is a non-recoverable dynamic error if the initial template
1801 * defines a template parameter that specifies required="yes".
1806 * If an implementation does not support backwards-compatible behavior,
1807 * then it is a non-recoverable dynamic error if any element is
1808 * evaluated that enables backwards-compatible behavior.
1813 * It is a recoverable dynamic error if this [the process of finding
1814 * an xsl:strip-space or xsl:preserve-space declaration to match
1815 * an element in the source document] leaves more than one match,
1816 * unless all the matched declarations are equivalent (that is,
1817 * they are all xsl:strip-space or they are all xsl:preserve-space).
1818 * Action: The optional recovery action is to select, from the matches
1819 * that are left, the one that occurs last in declaration order.
1824 * Where the result of evaluating an XPath expression (or an attribute
1825 * value template) is required to be a lexical QName, then unless
1826 * otherwise specified it is a non-recoverable dynamic error if
1827 * the defining element has no namespace node whose name matches
1828 * the prefix of the lexical QName. This error may be signaled as
1829 * a static error if the value of the expression can be determined
1835 * It is a non-recoverable dynamic error if the result sequence
1836 * used to construct the content of an element node contains a namespace
1837 * node or attribute node that is preceded in the sequence by a
1838 * node that is neither a namespace node nor an attribute node.
1843 * It is a non-recoverable dynamic error if the result sequence
1844 * used to construct the content of a document node contains a namespace
1845 * node or attribute node.
1850 * It is a non-recoverable dynamic error if the result sequence
1851 * contains two or more namespace nodes having the same name but
1852 * different string values (that is, namespace nodes that map the
1853 * same prefix to different namespace URIs).
1858 * It is a non-recoverable dynamic error if the result sequence
1859 * contains a namespace node with no name and the element node being
1860 * constructed has a null namespace URI (that is, it is an error
1861 * to define a default namespace when the element is in no namespace).
1866 * It is a non-recoverable dynamic error if namespace fixup is performed
1867 * on an element that contains among the typed values of the element
1868 * and its attributes two values of type xs:QName or xs:NOTATION
1869 * containing conflicting namespace prefixes, that is, two values
1870 * that use the same prefix to refer to different namespace URIs.
1875 * It is a recoverable dynamic error if the conflict resolution
1876 * algorithm for template rules leaves more than one matching template
1877 * rule. Action: The optional recovery action is to select, from
1878 * the matching template rules that are left, the one that occurs
1879 * last in declaration order.
1884 * It is a non-recoverable dynamic error if xsl:apply-imports or
1885 * xsl:next-match is evaluated when the current template rule is
1891 * If an optional parameter has no select attribute and has an empty
1892 * sequence constructor, and if there is an as attribute, then the
1893 * default value of the parameter is an empty sequence. If the empty
1894 * sequence is not a valid instance of the required type defined
1895 * in the as attribute, then the parameter is treated as a required
1896 * parameter, which means that it is a non-recoverable dynamic error
1897 * if the caller supplies no value for the parameter.
1902 * In general, a circularity in a stylesheet is a non-recoverable
1908 * In other cases, [with xsl:apply-templates, xsl:apply-imports,
1909 * and xsl:next-match, or xsl:call-template with tunnel parameters]
1910 * it is a non-recoverable dynamic error if the template that is
1911 * invoked declares a template parameter with required="yes" and
1912 * no value for this parameter is supplied by the calling instruction.
1917 * It is a recoverable dynamic error if the name of a constructed
1918 * attribute is xml:space and the value is not either default or
1919 * preserve. Action: The optional recovery action is to construct
1920 * the attribute with the value as requested.
1925 * It is a non-recoverable dynamic error if the effective value
1926 * of the name attribute [of the xsl:element instruction] is not
1932 * In the case of an xsl:element instruction with no namespace attribute,
1933 * it is a non-recoverable dynamic error if the effective value
1934 * of the name attribute is a QName whose prefix is not declared
1935 * in an in-scope namespace declaration for the xsl:element instruction.
1940 * It is a non-recoverable dynamic error if the effective value
1941 * of the namespace attribute [of the xsl:element instruction] is
1942 * not in the lexical space of the xs:anyURI data type.
1947 * It is a non-recoverable dynamic error if the effective value
1948 * of the name attribute [of an xsl:attribute instruction] is not
1954 * In the case of an xsl:attribute instruction with no namespace
1955 * attribute, it is a non-recoverable dynamic error if the effective
1956 * value of the name attribute is the string xmlns.
1961 * In the case of an xsl:attribute instruction with no namespace
1962 * attribute, it is a non-recoverable dynamic error if the effective
1963 * value of the name attribute is a lexical QName whose prefix is
1964 * not declared in an in-scope namespace declaration for the xsl:attribute
1970 * It is a non-recoverable dynamic error if the effective value
1971 * of the namespace attribute [of the xsl:attribute instruction]
1972 * is not in the lexical space of the xs:anyURI data type.
1977 * It is a non-recoverable dynamic error if the effective value
1978 * of the name attribute [of the xsl:processing-instruction instruction]
1979 * is not both an NCName Names and a PITarget XML.
1984 * It is a non-recoverable dynamic error if the string value of
1985 * the new namespace node [created using xsl:namespace] is not valid
1986 * in the lexical space of the data type xs:anyURI. [see ERR XTDE0835]
1991 * It is a non-recoverable dynamic error if the effective value
1992 * of the name attribute [of the xsl:namespace instruction] is neither
1993 * a zero-length string nor an NCName Names, or if it is xmlns.
1998 * It is a non-recoverable dynamic error if the xsl:namespace instruction
1999 * generates a namespace node whose name is xml and whose string
2000 * value is not http://www.w3.org/XML/1998/namespace, or a namespace
2001 * node whose string value is http://www.w3.org/XML/1998/namespace
2002 * and whose name is not xml.
2007 * It is a non-recoverable dynamic error if evaluating the select
2008 * attribute or the contained sequence constructor of an xsl:namespace
2009 * instruction results in a zero-length string.
2014 * It is a non-recoverable dynamic error if any undiscarded item
2015 * in the atomized sequence supplied as the value of the value attribute
2016 * of xsl:number cannot be converted to an integer, or if the resulting
2017 * integer is less than 0 (zero).
2022 * It is a non-recoverable dynamic error if, for any sort key component,
2023 * the set of sort key values evaluated for all the items in the
2024 * initial sequence, after any type conversion requested, contains
2025 * a pair of ordinary values for which the result of the XPath lt
2026 * operator is an error.
2031 * It is a non-recoverable dynamic error if the collation attribute
2032 * of xsl:sort (after resolving against the base URI) is not a URI
2033 * that is recognized by the implementation as referring to a collation.
2038 * It is a non-recoverable dynamic error if the collation URI specified
2039 * to xsl:for-each-group (after resolving against the base URI)
2040 * is a collation that is not recognized by the implementation.
2041 * (For notes, [see ERR XTDE1035].)
2046 * It is a non-recoverable dynamic error if the effective value
2047 * of the regex attribute [of the xsl:analyze-string instruction]
2048 * does not conform to the required syntax for regular expressions,
2049 * as specified in [Functions and Operators]. If the regular expression
2050 * is known statically (for example, if the attribute does not contain
2051 * any expressions enclosed in curly brackets) then the processor
2052 * may signal the error as a static error.
2057 * It is a non-recoverable dynamic error if the effective value
2058 * of the flags attribute [of the xsl:analyze-string instruction]
2059 * has a value other than the values defined in [Functions and Operators].
2060 * If the value of the attribute is known statically (for example,
2061 * if the attribute does not contain any expressions enclosed in
2062 * curly brackets) then the processor may signal the error as a
2068 * It is a non-recoverable dynamic error if the effective value
2069 * of the regex attribute [of the xsl:analyze-string instruction]
2070 * is a regular expression that matches a zero-length string: or
2071 * more specifically, if the regular expression $r and flags $f
2072 * are such that matches("", $r, $f) returns true. If the regular
2073 * expression is known statically (for example, if the attribute
2074 * does not contain any expressions enclosed in curly brackets)
2075 * then the processor may signal the error as a static error.
2080 * When a URI reference [supplied to the document function] contains
2081 * a fragment identifier, it is a recoverable dynamic error if the
2082 * media type is not one that is recognized by the processor, or
2083 * if the fragment identifier does not conform to the rules for
2084 * fragment identifiers for that media type, or if the fragment
2085 * identifier selects something other than a sequence of nodes (for
2086 * example, if it selects a range of characters within a text node).
2087 * Action: The optional recovery action is to ignore the fragment
2088 * identifier and return the document node.
2093 * It is a non-recoverable dynamic error if a URI [supplied in the
2094 * first argument to the unparsed-text function] contains a fragment
2095 * identifier, or if it cannot be used to retrieve a resource containing
2101 * It is a non-recoverable dynamic error if a resource [retrieved
2102 * using the unparsed-text function] contains octets that cannot
2103 * be decoded into Unicode characters using the specified encoding,
2104 * or if the resulting characters are not permitted XML characters.
2105 * This includes the case where the processor does not support the
2106 * requested encoding.
2111 * It is a non-recoverable dynamic error if the second argument
2112 * of the unparsed-text function is omitted and the processor cannot
2113 * infer the encoding using external information and the encoding
2119 * It is a non-recoverable dynamic error if the value [of the first
2120 * argument to the key function] is not a valid QName, or if there
2121 * is no namespace declaration in scope for the prefix of the QName,
2122 * or if the name obtained by expanding the QName is not the same
2123 * as the expanded name of any xsl:key declaration in the stylesheet.
2124 * If the processor is able to detect the error statically (for
2125 * example, when the argument is supplied as a string literal),
2126 * then the processor may optionally signal this as a static error.
2131 * It is a non-recoverable dynamic error to call the key function
2132 * with two arguments if there is no context node, or if the root
2133 * of the tree containing the context node is not a document node;
2134 * or to call the function with three arguments if the root of the
2135 * tree containing the node supplied in the third argument is not
2141 * It is a non-recoverable dynamic error if the name specified as
2142 * the $decimal-format-name argument [ to the format-number function]
2143 * is not a valid QName, or if its prefix has not been declared
2144 * in an in-scope namespace declaration, or if the stylesheet does
2145 * not contain a declaration of a decimal-format with a matching
2146 * expanded-QName. If the processor is able to detect the error
2147 * statically (for example, when the argument is supplied as a string
2148 * literal), then the processor may optionally signal this as a
2154 * The picture string [supplied to the format-number function] must
2155 * conform to the following rules. [ See full specification.] It
2156 * is a non-recoverable dynamic error if the picture string does
2157 * not satisfy these rules.
2162 * It is a non-recoverable dynamic error if the syntax of the picture
2163 * [used for date/time formatting] is incorrect.
2168 * It is a non-recoverable dynamic error if a component specifier
2169 * within the picture [used for date/time formatting] refers to
2170 * components that are not available in the given type of $value,
2171 * for example if the picture supplied to the format-time refers
2172 * to the year, month, or day component.
2177 * If the current function is evaluated within an expression that
2178 * is evaluated when the context item is undefined, a non-recoverable
2179 * dynamic error occurs.
2184 * It is a non-recoverable dynamic error if the unparsed-entity-uri
2185 * function is called when there is no context node, or when the
2186 * root of the tree containing the context node is not a document
2192 * It is a non-recoverable dynamic error if the unparsed-entity-public-id
2193 * function is called when there is no context node, or when the
2194 * root of the tree containing the context node is not a document
2200 * It is a non-recoverable dynamic error if the value [supplied
2201 * as the $property-name argument to the system-property function]
2202 * is not a valid QName, or if there is no namespace declaration
2203 * in scope for the prefix of the QName. If the processor is able
2204 * to detect the error statically (for example, when the argument
2205 * is supplied as a string literal), then the processor may optionally
2206 * signal this as a static error.
2211 * When a transformation is terminated by use of xsl:message terminate="yes",
2212 * the effect is the same as when a non-recoverable dynamic error
2213 * occurs during the transformation.
2218 * It is a non-recoverable dynamic error if the argument [passed
2219 * to the function-available function] does not evaluate to a string
2220 * that is a valid QName, or if there is no namespace declaration
2221 * in scope for the prefix of the QName. If the processor is able
2222 * to detect the error statically (for example, when the argument
2223 * is supplied as a string literal), then the processor may optionally
2224 * signal this as a static error.
2229 * It is a non-recoverable dynamic error if the arguments supplied
2230 * to a call on an extension function do not satisfy the rules defined
2231 * for that particular extension function, or if the extension function
2232 * reports an error, or if the result of the extension function
2233 * cannot be converted to an XPath value.
2238 * When backwards compatible behavior is enabled, it is a non-recoverable
2239 * dynamic error to evaluate an extension function call if no implementation
2240 * of the extension function is available.
2245 * It is a non-recoverable dynamic error if the argument [passed
2246 * to the type-available function] does not evaluate to a string
2247 * that is a valid QName, or if there is no namespace declaration
2248 * in scope for the prefix of the QName. If the processor is able
2249 * to detect the error statically (for example, when the argument
2250 * is supplied as a string literal), then the processor may optionally
2251 * signal this as a static error.
2256 * It is a non-recoverable dynamic error if the argument [passed
2257 * to the element-available function] does not evaluate to a string
2258 * that is a valid QName, or if there is no namespace declaration
2259 * in scope for the prefix of the QName. If the processor is able
2260 * to detect the error statically (for example, when the argument
2261 * is supplied as a string literal), then the processor may optionally
2262 * signal this as a static error.
2267 * When a processor performs fallback for an extension instruction
2268 * that is not recognized, if the instruction element has one or
2269 * more xsl:fallback children, then the content of each of the xsl:fallback
2270 * children must be evaluated; it is a non-recoverable dynamic error
2271 * if it has no xsl:fallback children.
2276 * It is a non-recoverable dynamic error if the effective value
2277 * of the format attribute [of an xsl:result-document element] is
2278 * not a valid lexical QName, or if it does not match the expanded-QName
2279 * of an output definition in the stylesheet. If the processor is
2280 * able to detect the error statically (for example, when the format
2281 * attribute contains no curly brackets), then the processor may
2282 * optionally signal this as a static error.
2287 * It is a non-recoverable dynamic error to evaluate the xsl:result-document
2288 * instruction in temporary output state.
2293 * It is a non-recoverable dynamic error for a transformation to
2294 * generate two or more final result trees with the same URI.
2299 * It is a recoverable dynamic error for a transformation to generate
2300 * two or more final result trees with URIs that identify the same
2301 * physical resource. The optional recovery action is implementation-dependent,
2302 * since it may be impossible for the processor to detect the error.
2307 * It is a recoverable dynamic error for a stylesheet to write to
2308 * an external resource and read from the same resource during a
2309 * single transformation, whether or not the same URI is used to
2310 * access the resource in both cases. Action: The optional recovery
2311 * action is implementation-dependent: implementations are not required
2312 * to detect the error condition. Note that if the error is not
2313 * detected, it is undefined whether the document that is read from
2314 * the resource reflects its state before or after the result tree
2320 * It is a recoverable dynamic error if an xsl:value-of or xsl:text
2321 * instruction specifies that output escaping is to be disabled
2322 * and the implementation does not support this. Action: The optional
2323 * recovery action is to ignore the disable-output-escaping attribute.
2328 * It is a recoverable dynamic error if an xsl:value-of or xsl:text
2329 * instruction specifies that output escaping is to be disabled
2330 * when writing to a final result tree that is not being serialized.
2331 * Action: The optional recovery action is to ignore the disable-output-escaping
2337 * A basic XSLT processor must raise a non-recoverable dynamic error
2338 * if the input to the processor includes a node with a type annotation
2339 * other than xs:untyped or xs:untypedAtomic, or an atomic value
2340 * of a type other than those which a basic XSLT processor supports.
2347 * Issues a warning, should not be used excessively. This can
2348 * be used to communicate that a certain implementation defined
2349 * feature is unsupported or that a certain expression most likely
2350 * doesn't do what the users wants, to name a few examples.
2352 * @see <a href="http://www.w3.org/TR/xpath20/#errors">XML Path Language (XPath) 2.0,
2353 * 2.3 Error Handling</a>
2354 * @param message the message to be read by the user.
2355 * @param sourceLocation the location of where the warning originates from.
2357 void warning(const QString &message, const QSourceLocation &sourceLocation = QSourceLocation());
2360 * Issues an error. May be used at the static analysis phase or
2361 * the dynamic evaluation phase.
2363 * For SourceLocationReflection instances, the overload taking an SouourceLocationReflection should be used.
2365 * @see <a href="http://www.w3.org/TR/xpath20/#errors">XML Path Language (XPath) 2.0,
2366 * 2.3 Error Handling</a>
2367 * @param message the message to be read by the user.
2368 * @param errorCode identifies the error condition, as described
2369 * @param sourceLocation the location of where the error originates from
2370 * in "XML Path Language (XPath) 2.0" section "G Error Conditions"
2372 void error(const QString &message,
2373 const ReportContext::ErrorCode errorCode,
2374 const QSourceLocation &sourceLocation);
2379 * Same as the above, but passes the SourceLocationReflection as reference for error reporting.
2381 void error(const QString &message,
2382 const ReportContext::ErrorCode errorCode,
2383 const SourceLocationReflection *const reflection);
2386 * Issues an error which is not identified in the XPath specifications. This function
2387 * is among other things used for implementing the <tt>fn:error()</tt> function.
2389 void error(const QString &message,
2390 const QXmlName qName,
2391 const SourceLocationReflection *const r);
2394 * @return the QAbstractMessageHandler which functions such as warning() and
2395 * error() should submit messages to. This function
2396 * may never return @c null; a valid QAbstractMessageHandler pointer must always be returned.
2398 virtual QAbstractMessageHandler *messageHandler() const = 0;
2400 virtual NamePool::Ptr namePool() const = 0;
2403 * Returns a string representation of the error code @p code.
2405 * @see ReportContext::ErrorCode
2406 * @param errorCode identifies the error condition, as described
2407 * in <a href="http://www.w3.org/TR/xpath20/#id-errors">XML Path
2408 * Language (XPath) 2.0, G Error Conditions</a>
2410 static QString codeToString(const ReportContext::ErrorCode errorCode);
2413 * @returns the error code part of @p typeURI and sets @p uri to the error namespace. Note
2414 * that the error namespace not necessarily is the namespace for XPath and
2415 * XQuery errors, http://www.w3.org/2005/xqt-errors, but can be user defined.
2417 static QString codeFromURI(const QString &typeURI,
2421 * @short Returns the source location applying for @p reflection.
2423 virtual QSourceLocation locationFor(const SourceLocationReflection *const reflection) const = 0;
2426 * Resolves @p relative against @p baseURI, possibly using a URI resolver.
2428 QUrl resolveURI(const QUrl &relative,
2429 const QUrl &baseURI) const;
2432 * @short The URI resolver in use.
2434 * If no URI resolver is in use, a @c null pointer is returned.
2436 * @note You should probably use resolveURI(), which handles the case of
2437 * when uriResolver() is @c null.
2439 virtual const QAbstractUriResolver *uriResolver() const = 0;
2442 void createError(const QString &description,
2443 const QtMsgType type,
2445 const QSourceLocation &sourceLocation) const;
2446 static inline QString finalizeDescription(const QString &desc);
2447 QSourceLocation lookupSourceLocation(const SourceLocationReflection *const ref) const;
2449 Q_DISABLE_COPY(ReportContext)
2453 * @short This is the class type that is being thrown when a query error occur.
2455 * @relates ReportContext
2457 typedef bool Exception;