1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40//
41// W A R N I N G
42// -------------
43//
44// This file is not part of the Qt API. It exists purely as an
45// implementation detail. This header file may change from version to
46// version without notice, or even be removed.
47//
48// We mean it.
49
50#ifndef Patternist_ReportContext_H
51#define Patternist_ReportContext_H
52
53#include <QSharedData>
54#include <QAbstractUriResolver>
55#include <QSourceLocation>
56
57#include <private/qnamepool_p.h>
58#include <QXmlName>
59
60QT_BEGIN_NAMESPACE
61
62class QAbstractMessageHandler;
63class QSourceLocation;
64class QString;
65
66namespace QPatternist
67{
68 class SourceLocationReflection;
69
70 /**
71 * @short A callback for reporting errors.
72 *
73 * ReportContext receives messages of various severity and type via its
74 * functions warning() and error(). In turn, ReportContext create Message instances
75 * and submit them to the QAbstractMessageHandler instance returned by messageHandler().
76 *
77 * The Message attributes are set as follows:
78 *
79 * - Message::description() - A translated, human-readable description
80 * - Message::type() - Message::Error if a static, dynamic or type error was encountered
81 * that halted compilation or evaluation, or Message::Warning in case of a warning
82 * - Message::identifier() - This is a URI consisting of the error namespace with the
83 * error code as fragment. For example, a Message representing a syntax error
84 * would return the type "http://www.w3.org/2005/xqt-errors#XPST0003". The convenience
85 * function codeFromURI() can be used to extract the error code. The error namespace
86 * is typically the namespace for XPath and XQuery errors(as in the previous example), but
87 * can also be user defined.
88 *
89 * @see <a href="http://www.w3.org/TR/xpath20/#id-identifying-errors">XML Path Language
90 * (XPath) 2.0, 2.3.2 Identifying and Reporting Errors</a>
91 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-error">XQuery 1.0 and
92 * XPath 2.0 Functions and Operators, 3 The Error Function</a>
93 * @author Frans Englich <frans.englich@nokia.com>
94 * @warning This file is auto-generated from extractErrorCodes.xsl. Any
95 * modifications done to this file are lost.
96 */
97 class Q_AUTOTEST_EXPORT ReportContext : public QSharedData
98 {
99 public:
100 typedef QHash<const SourceLocationReflection *, QSourceLocation> LocationHash;
101
102 /**
103 * A smart pointer wrapping ReportContext instances.
104 */
105 typedef QExplicitlySharedDataPointer<ReportContext> Ptr;
106
107 /**
108 * @short Default constructors.
109 *
110 * For some reason GCC fails to synthesize it, so we provide an empty
111 * one here.
112 */
113 inline ReportContext() {}
114
115 virtual ~ReportContext();
116
117 /**
118 * Error codes that corresponds to the error codes defined in the
119 * relevant specifications. They are used throughout the API for
120 * identifying error conditions.
121 *
122 * While strings could have been used for identifying errors, enums
123 * reduces bugs by providing type safety.
124 *
125 * @see <a href="http://www.w3.org/TR/xpath20/#errors">XML
126 * Path Language (XPath) 2.0, 2.3 Error Handling</a>
127 * @see <a href="http://www.w3.org/TR/xpath-functions/#d1e10985">XQuery 1.0
128 * and XPath 2.0 Functions and Operators, C Error Summary</a>
129 * @see <a href="http://www.w3.org/TR/xslt20/#error-summary">XSL Transformations
130 * (XSLT) Version 2.0, E Summary of Error Conditions (Non-Normative)</a>
131 * @note The enumerator values' Doxygen documentation is copied from the
132 * W3C documents
133 * <a href="http://www.w3.org/TR/xpath-functions">XQuery 1.0 and XPath
134 * 2.0 Functions and Operators</a>,
135 * <a href="http://www.w3.org/TR/xpath20">XML Path Language (XPath) 2.0</a>, and
136 * <a href="http://www.w3.org/TR/xslt20/">XSL Transformations (XSLT)
137 * Version 2.0</a>, respectively. The doxygen documentation is therefore covered
138 * by the following legal notice:
139 * "Copyright @ 2005 W3C&reg; (MIT, ERCIM, Keio), All Rights Reserved. W3C
140 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
141 * <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
142 * <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document
143 * use</a> rules apply."
144 * @warning This enumerator is auto-generated from the relevant specifications
145 * by the XSL-T stylesheet extractErrorCodes.xsl. Hence, any modifications
146 * done to this file, in contrary to the stylesheet, are therefore lost.
147 */
148 enum ErrorCode
149 {
150 /**
151 * XML Schema error code.
152 */
153 XSDError,
154
155 /**
156 * It is a static error if analysis of an expression relies on some
157 * component of the static context that has not been assigned a
158 * value.
159 */
160 XPST0001,
161
162 /**
163 * It is a dynamic error if evaluation of an expression relies on
164 * some part of the dynamic context that has not been assigned a
165 * value.
166 */
167 XPDY0002,
168
169 /**
170 * It is a static error if an expression is not a valid instance
171 * of the grammar defined in A.1 EBNF.
172 */
173 XPST0003,
174
175 /**
176 * It is a type error if, during the static analysis phase, an expression
177 * is found to have a static type that is not appropriate for the
178 * context in which the expression occurs, or during the dynamic
179 * evaluation phase, the dynamic type of a value does not match
180 * a required type as specified by the matching rules in 2.5.4 SequenceType
181 * Matching.
182 */
183 XPTY0004,
184
185 /**
186 * During the analysis phase, it is a static error if the static
187 * type assigned to an expression other than the expression () or
188 * data(()) is empty-sequence().
189 */
190 XPST0005,
191
192 /**
193 * (Not currently used.)
194 */
195 XPTY0006,
196
197 /**
198 * (Not currently used.)
199 */
200 XPTY0007,
201
202 /**
203 * It is a static error if an expression refers to an element name,
204 * attribute name, schema type name, namespace prefix, or variable
205 * name that is not defined in the static context, except for an
206 * ElementName in an ElementTest or an AttributeName in an AttributeTest.
207 */
208 XPST0008,
209
210 /**
211 * An implementation that does not support the Schema Import Feature
212 * must raise a static error if a Prolog contains a schema import.
213 */
214 XQST0009,
215
216 /**
217 * An implementation must raise a static error if it encounters
218 * a reference to an axis that it does not support.
219 */
220 XPST0010,
221
222 /**
223 * It is a static error if the set of definitions contained in all
224 * schemas imported by a Prolog do not satisfy the conditions for
225 * schema validity specified in Sections 3 and 5 of [XML Schema]
226 * Part 1--i.e., each definition must be valid, complete, and unique.
227 */
228 XQST0012,
229
230 /**
231 * It is a static error if an implementation recognizes a pragma
232 * but determines that its content is invalid.
233 */
234 XQST0013,
235
236 /**
237 * (Not currently used.)
238 */
239 XQST0014,
240
241 /**
242 * (Not currently used.)
243 */
244 XQST0015,
245
246 /**
247 * An implementation that does not support the Module Feature raises
248 * a static error if it encounters a module declaration or a module
249 * import.
250 */
251 XQST0016,
252
253 /**
254 * It is a static error if the expanded QName and number of arguments
255 * in a function call do not match the name and arity of a function
256 * signature in the static context.
257 */
258 XPST0017,
259
260 /**
261 * It is a type error if the result of the last step in a path expression
262 * contains both nodes and atomic values.
263 */
264 XPTY0018,
265
266 /**
267 * It is a type error if the result of a step (other than the last
268 * step) in a path expression contains an atomic value.
269 */
270 XPTY0019,
271
272 /**
273 * It is a type error if, in an axis step, the context item is not
274 * a node.
275 */
276 XPTY0020,
277
278 /**
279 * (Not currently used.)
280 */
281 XPDY0021,
282
283 /**
284 * It is a static error if the value of a namespace declaration
285 * attribute is not a URILiteral.
286 */
287 XQST0022,
288
289 /**
290 * (Not currently used.)
291 */
292 XQTY0023,
293
294 /**
295 * It is a type error if the content sequence in an element constructor
296 * contains an attribute node following a node that is not an attribute
297 * node.
298 */
299 XQTY0024,
300
301 /**
302 * It is a dynamic error if any attribute of a constructed element
303 * does not have a name that is distinct from the names of all other
304 * attributes of the constructed element.
305 */
306 XQDY0025,
307
308 /**
309 * It is a dynamic error if the result of the content expression
310 * of a computed processing instruction constructor contains the
311 * string "?&gt;".
312 */
313 XQDY0026,
314
315 /**
316 * In a validate expression, it is a dynamic error if the root element
317 * information item in the PSVI resulting from validation does not
318 * have the expected validity property: valid if validation mode
319 * is strict, or either valid or notKnown if validation mode is
320 * lax.
321 */
322 XQDY0027,
323
324 /**
325 * (Not currently used.)
326 */
327 XQTY0028,
328
329 /**
330 * (Not currently used.)
331 */
332 XQDY0029,
333
334 /**
335 * It is a type error if the argument of a validate expression does
336 * not evaluate to exactly one document or element node.
337 */
338 XQTY0030,
339
340 /**
341 * It is a static error if the version number specified in a version
342 * declaration is not supported by the implementation.
343 */
344 XQST0031,
345
346 /**
347 * A static error is raised if a Prolog contains more than one base
348 * URI declaration.
349 */
350 XQST0032,
351
352 /**
353 * It is a static error if a module contains multiple bindings for
354 * the same namespace prefix.
355 */
356 XQST0033,
357
358 /**
359 * It is a static error if multiple functions declared or imported
360 * by a module have the number of arguments and their expanded QNames
361 * are equal (as defined by the eq operator).
362 */
363 XQST0034,
364
365 /**
366 * It is a static error to import two schema components that both
367 * define the same name in the same symbol space and in the same
368 * scope.
369 */
370 XQST0035,
371
372 /**
373 * It is a static error to import a module if the importing module's
374 * in-scope schema types do not include definitions for the schema
375 * type names that appear in the declarations of variables and functions
376 * (whether in an argument type or return type) that are present
377 * in the imported module and are referenced in the importing module.
378 */
379 XQST0036,
380
381 /**
382 * (Not currently used.)
383 */
384 XQST0037,
385
386 /**
387 * It is a static error if a Prolog contains more than one default
388 * collation declaration, or the value specified by a default collation
389 * declaration is not present in statically known collations.
390 */
391 XQST0038,
392
393 /**
394 * It is a static error for a function declaration to have more
395 * than one parameter with the same name.
396 */
397 XQST0039,
398
399 /**
400 * It is a static error if the attributes specified by a direct
401 * element constructor do not have distinct expanded QNames.
402 */
403 XQST0040,
404
405 /**
406 * It is a dynamic error if the value of the name expression in
407 * a computed processing instruction constructor cannot be cast
408 * to the type xs:NCName.
409 */
410 XQDY0041,
411
412 /**
413 * (Not currently used.)
414 */
415 XQST0042,
416
417 /**
418 * (Not currently used.)
419 */
420 XQST0043,
421
422 /**
423 * It is a dynamic error if the node-name property of the node constructed
424 * by a computed attribute constructor is in the namespace http://www.w3.org/2000/xmlns/
425 * (corresponding to namespace prefix xmlns), or is in no namespace
426 * and has local name xmlns.
427 */
428 XQDY0044,
429
430 /**
431 * It is a static error if the function name in a function declaration
432 * is in one of the following namespaces: http://www.w3.org/XML/1998/namespace,
433 * http://www.w3.org/2001/XMLSchema, http://www.w3.org/2001/XMLSchema-instance,
434 * http://www.w3.org/2005/xpath-functions.
435 */
436 XQST0045,
437
438 /**
439 * An implementation MAY raise a static error if the value of a
440 * URILiteral is of nonzero length and is not in the lexical space
441 * of xs:anyURI.
442 */
443 XQST0046,
444
445 /**
446 * It is a static error if multiple module imports in the same Prolog
447 * specify the same target namespace.
448 */
449 XQST0047,
450
451 /**
452 * It is a static error if a function or variable declared in a
453 * library module is not in the target namespace of the library
454 * module.
455 */
456 XQST0048,
457
458 /**
459 * It is a static error if two or more variables declared or imported
460 * by a module have equal expanded QNames (as defined by the eq
461 * operator.)
462 */
463 XQST0049,
464
465 /**
466 * It is a dynamic error if the dynamic type of the operand of a
467 * treat expression does not match the sequence type specified by
468 * the treat expression. This error might also be raised by a path
469 * expression beginning with "/" or "//" if the context node is
470 * not in a tree that is rooted at a document node. This is because
471 * a leading "/" or "//" in a path expression is an abbreviation
472 * for an initial step that includes the clause treat as document-node().
473 */
474 XPDY0050,
475
476 /**
477 * It is a static error if a QName that is used as an AtomicType
478 * in a SequenceType is not defined in the in-scope schema types
479 * as an atomic type.
480 */
481 XPST0051,
482
483 /**
484 * (Not currently used.)
485 */
486 XQDY0052,
487
488 /**
489 * (Not currently used.)
490 */
491 XQST0053,
492
493 /**
494 * It is a static error if a variable depends on itself.
495 */
496 XQST0054,
497
498 /**
499 * It is a static error if a Prolog contains more than one copy-namespaces
500 * declaration.
501 */
502 XQST0055,
503
504 /**
505 * (Not currently used.)
506 */
507 XQST0056,
508
509 /**
510 * It is a static error if a schema import binds a namespace prefix
511 * but does not specify a target namespace other than a zero-length
512 * string.
513 */
514 XQST0057,
515
516 /**
517 * It is a static error if multiple schema imports specify the same
518 * target namespace.
519 */
520 XQST0058,
521
522 /**
523 * It is a static error if an implementation is unable to process
524 * a schema or module import by finding a schema or module with
525 * the specified target namespace.
526 */
527 XQST0059,
528
529 /**
530 * It is a static error if the name of a function in a function
531 * declaration is not in a namespace (expanded QName has a null
532 * namespace URI).
533 */
534 XQST0060,
535
536 /**
537 * It is a dynamic error if the operand of a validate expression
538 * is a document node whose children do not consist of exactly one
539 * element node and zero or more comment and processing instruction
540 * nodes, in any order.
541 */
542 XQDY0061,
543
544 /**
545 * (Not currently used.)
546 */
547 XQDY0062,
548
549 /**
550 * (Not currently used.)
551 */
552 XQST0063,
553
554 /**
555 * It is a dynamic error if the value of the name expression in
556 * a computed processing instruction constructor is equal to "XML"
557 * (in any combination of upper and lower case).
558 */
559 XQDY0064,
560
561 /**
562 * A static error is raised if a Prolog contains more than one ordering
563 * mode declaration.
564 */
565 XQST0065,
566
567 /**
568 * A static error is raised if a Prolog contains more than one default
569 * element/type namespace declaration, or more than one default
570 * function namespace declaration.
571 */
572 XQST0066,
573
574 /**
575 * A static error is raised if a Prolog contains more than one construction
576 * declaration.
577 */
578 XQST0067,
579
580 /**
581 * A static error is raised if a Prolog contains more than one boundary-space
582 * declaration.
583 */
584 XQST0068,
585
586 /**
587 * A static error is raised if a Prolog contains more than one empty
588 * order declaration.
589 */
590 XQST0069,
591
592 /**
593 * A static error is raised if a namespace URI is bound to the predefined
594 * prefix xmlns, or if a namespace URI other than http://www.w3.org/XML/1998/namespace
595 * is bound to the prefix xml, or if the prefix xml is bound to
596 * a namespace URI other than http://www.w3.org/XML/1998/namespace.
597 */
598 XQST0070,
599
600 /**
601 * A static error is raised if the namespace declaration attributes
602 * of a direct element constructor do not have distinct names.
603 */
604 XQST0071,
605
606 /**
607 * It is a dynamic error if the result of the content expression
608 * of a computed comment constructor contains two adjacent hyphens
609 * or ends with a hyphen.
610 */
611 XQDY0072,
612
613 /**
614 * It is a static error if the graph of module imports contains
615 * a cycle (that is, if there exists a sequence of modules M1 ...
616 * Mn such that each Mi imports Mi+1 and Mn imports M1), unless
617 * all the modules in the cycle share a common namespace.
618 */
619 XQST0073,
620
621 /**
622 * It is a dynamic error if the value of the name expression in
623 * a computed element or attribute constructor cannot be converted
624 * to an expanded QName (for example, because it contains a namespace
625 * prefix not found in statically known namespaces.)
626 */
627 XQDY0074,
628
629 /**
630 * An implementation that does not support the Validation Feature
631 * must raise a static error if it encounters a validate expression.
632 */
633 XQST0075,
634
635 /**
636 * It is a static error if a collation subclause in an order by
637 * clause of a FLWOR expression does not identify a collation that
638 * is present in statically known collations.
639 */
640 XQST0076,
641
642 /**
643 * (Not currently used.)
644 */
645 XQST0077,
646
647 /**
648 * (Not currently used.)
649 */
650 XQST0078,
651
652 /**
653 * It is a static error if an extension expression contains neither
654 * a pragma that is recognized by the implementation nor an expression
655 * enclosed in curly braces.
656 */
657 XQST0079,
658
659 /**
660 * It is a static error if the target type of a cast or castable
661 * expression is xs:NOTATION or xs:anyAtomicType.
662 */
663 XPST0080,
664
665 /**
666 * It is a static error if a QName used in a query contains a namespace
667 * prefix that cannot be expanded into a namespace URI by using
668 * the statically known namespaces.
669 */
670 XPST0081,
671
672 /**
673 * (Not currently used.)
674 */
675 XQST0082,
676
677 /**
678 * (Not currently used.)
679 */
680 XPST0083,
681
682 /**
683 * It is a dynamic error if the element validated by a validate
684 * statement does not have a top-level element declaration in the
685 * in-scope element declarations, if validation mode is strict.
686 */
687 XQDY0084,
688
689 /**
690 * It is a static error if the namespace URI in a namespace declaration
691 * attribute is a zero-length string, and the implementation does
692 * not support [XML Names 1.1].
693 */
694 XQST0085,
695
696 /**
697 * It is a type error if the typed value of a copied element or
698 * attribute node is namespace-sensitive when construction mode
699 * is preserve and copy-namespaces mode is no-preserve.
700 */
701 XQTY0086,
702
703 /**
704 * It is a static error if the encoding specified in a Version Declaration
705 * does not conform to the definition of EncName specified in [XML
706 * 1.0].
707 */
708 XQST0087,
709
710 /**
711 * It is a static error if the literal that specifies the target
712 * namespace in a module import or a module declaration is of zero
713 * length.
714 */
715 XQST0088,
716
717 /**
718 * It is a static error if a variable bound in a for clause of a
719 * FLWOR expression, and its associated positional variable, do
720 * not have distinct names (expanded QNames).
721 */
722 XQST0089,
723
724 /**
725 * It is a static error if a character reference does not identify
726 * a valid character in the version of XML that is in use.
727 */
728 XQST0090,
729
730 /**
731 * An implementation MAY raise a dynamic error if an xml:id error,
732 * as defined in [XML ID], is encountered during construction of
733 * an attribute named xml:id.
734 */
735 XQDY0091,
736
737 /**
738 * An implementation MAY raise a dynamic error if a constructed
739 * attribute named xml:space has a value other than preserve or
740 * default.
741 */
742 XQDY0092,
743
744 /**
745 * It is a static error to import a module M1 if there exists a
746 * sequence of modules M1 ... Mi ... M1 such that each module directly
747 * depends on the next module in the sequence (informally, if M1
748 * depends on itself through some chain of module dependencies.)
749 */
750 XQST0093,
751
752 /**
753 * Unidentified error.
754 */
755 FOER0000,
756
757 /**
758 * Division by zero.
759 */
760 FOAR0001,
761
762 /**
763 * Numeric operation overflow/underflow.
764 */
765 FOAR0002,
766
767 /**
768 * Input value too large for decimal.
769 */
770 FOCA0001,
771
772 /**
773 * Invalid lexical value.
774 */
775 FOCA0002,
776
777 /**
778 * Input value too large for integer.
779 */
780 FOCA0003,
781
782 /**
783 * NaN supplied as float/double value.
784 */
785 FOCA0005,
786
787 /**
788 * String to be cast to decimal has too many digits of precision.
789 */
790 FOCA0006,
791
792 /**
793 * Code point not valid.
794 */
795 FOCH0001,
796
797 /**
798 * Unsupported collation.
799 */
800 FOCH0002,
801
802 /**
803 * Unsupported normalization form.
804 */
805 FOCH0003,
806
807 /**
808 * Collation does not support collation units.
809 */
810 FOCH0004,
811
812 /**
813 * No context document.
814 */
815 FODC0001,
816
817 /**
818 * Error retrieving resource.
819 */
820 FODC0002,
821
822 /**
823 * Function stability not defined.
824 */
825 FODC0003,
826
827 /**
828 * Invalid argument to fn:collection.
829 */
830 FODC0004,
831
832 /**
833 * Invalid argument to fn:doc or fn:doc-available.
834 */
835 FODC0005,
836
837 /**
838 * Overflow/underflow in date/time operation.
839 */
840 FODT0001,
841
842 /**
843 * Overflow/underflow in duration operation.
844 */
845 FODT0002,
846
847 /**
848 * Invalid timezone value.
849 */
850 FODT0003,
851
852 /**
853 * No namespace found for prefix.
854 */
855 FONS0004,
856
857 /**
858 * Base-uri not defined in the static context.
859 */
860 FONS0005,
861
862 /**
863 * Invalid value for cast/constructor.
864 */
865 FORG0001,
866
867 /**
868 * Invalid argument to fn:resolve-uri().
869 */
870 FORG0002,
871
872 /**
873 * fn:zero-or-one called with a sequence containing more than one
874 * item.
875 */
876 FORG0003,
877
878 /**
879 * fn:one-or-more called with a sequence containing no items.
880 */
881 FORG0004,
882
883 /**
884 * fn:exactly-one called with a sequence containing zero or more
885 * than one item.
886 */
887 FORG0005,
888
889 /**
890 * Invalid argument type.
891 */
892 FORG0006,
893
894 /**
895 * Both arguments to fn:dateTime have a specified timezone.
896 */
897 FORG0008,
898
899 /**
900 * Error in resolving a relative URI against a base URI in fn:resolve-uri.
901 */
902 FORG0009,
903
904 /**
905 * Invalid regular expression. flags
906 */
907 FORX0001,
908
909 /**
910 * Invalid regular expression.
911 */
912 FORX0002,
913
914 /**
915 * Regular expression matches zero-length string.
916 */
917 FORX0003,
918
919 /**
920 * Invalid replacement string.
921 */
922 FORX0004,
923
924 /**
925 * Argument node does not have a typed value.
926 */
927 FOTY0012,
928
929 /**
930 * It is an error if an item in S6 in sequence normalization is
931 * an attribute node or a namespace node.
932 */
933 SENR0001,
934
935 /**
936 * It is an error if the serializer is unable to satisfy the rules
937 * for either a well-formed XML document entity or a well-formed
938 * XML external general parsed entity, or both, except for content
939 * modified by the character expansion phase of serialization.
940 */
941 SERE0003,
942
943 /**
944 * It is an error to specify the doctype-system parameter, or to
945 * specify the standalone parameter with a value other than omit,
946 * if the instance of the data model contains text nodes or multiple
947 * element nodes as children of the root node.
948 */
949 SEPM0004,
950
951 /**
952 * It is an error if the serialized result would contain an NCName
953 * Names that contains a character that is not permitted by the
954 * version of Namespaces in XML specified by the version parameter.
955 */
956 SERE0005,
957
958 /**
959 * It is an error if the serialized result would contain a character
960 * that is not permitted by the version of XML specified by the
961 * version parameter.
962 */
963 SERE0006,
964
965 /**
966 * It is an error if an output encoding other than UTF-8 or UTF-16
967 * is requested and the serializer does not support that encoding.
968 */
969 SESU0007,
970
971 /**
972 * It is an error if a character that cannot be represented in the
973 * encoding that the serializer is using for output appears in a
974 * context where character references are not allowed (for example
975 * if the character occurs in the name of an element).
976 */
977 SERE0008,
978
979 /**
980 * It is an error if the omit-xml-declaration parameter has the
981 * value yes, and the standalone attribute has a value other than
982 * omit; or the version parameter has a value other than 1.0 and
983 * the doctype-system parameter is specified.
984 */
985 SEPM0009,
986
987 /**
988 * It is an error if the output method is xml, the value of the
989 * undeclare-prefixes parameter is yes, and the value of the version
990 * parameter is 1.0.
991 */
992 SEPM0010,
993
994 /**
995 * It is an error if the value of the normalization-form parameter
996 * specifies a normalization form that is not supported by the serializer.
997 */
998 SESU0011,
999
1000 /**
1001 * It is an error if the value of the normalization-form parameter
1002 * is fully-normalized and any relevant construct of the result
1003 * begins with a combining character.
1004 */
1005 SERE0012,
1006
1007 /**
1008 * It is an error if the serializer does not support the version
1009 * of XML or HTML specified by the version parameter.
1010 */
1011 SESU0013,
1012
1013 /**
1014 * It is an error to use the HTML output method when characters
1015 * which are legal in XML but not in HTML, specifically the control
1016 * characters \#x7F-#x9F, appear in the instance of the data model.
1017 */
1018 SERE0014,
1019
1020 /**
1021 * It is an error to use the HTML output method when &gt; appears within
1022 * a processing instruction in the data model instance being serialized.
1023 */
1024 SERE0015,
1025
1026 /**
1027 * It is a an error if a parameter value is invalid for the defined
1028 * domain.
1029 */
1030 SEPM0016,
1031
1032 /**
1033 * A static error is signaled if an XSLT-defined element is used
1034 * in a context where it is not permitted, if a required attribute
1035 * is omitted, or if the content of the element does not correspond
1036 * to the content that is allowed for the element.
1037 */
1038 XTSE0010,
1039
1040 /**
1041 * It is a static error if an attribute (other than an attribute
1042 * written using curly brackets in a position where an attribute
1043 * value template is permitted) contains a value that is not one
1044 * of the permitted values for that attribute.
1045 */
1046 XTSE0020,
1047
1048 /**
1049 * It is a static error to use a reserved namespace in the name
1050 * of a named template, a mode, an attribute set, a key, a decimal-format,
1051 * a variable or parameter, a stylesheet function, a named output
1052 * definition, or a character map.
1053 */
1054 XTSE0080,
1055
1056 /**
1057 * It is a static error for an element from the XSLT namespace to
1058 * have an attribute whose namespace is either null (that is, an
1059 * attribute with an unprefixed name) or the XSLT namespace, other
1060 * than attributes defined for the element in this document.
1061 */
1062 XTSE0090,
1063
1064 /**
1065 * The value of the version attribute must be a number: specifically,
1066 * it must be a a valid instance of the type xs:decimal as defined
1067 * in [XML Schema Part 2].
1068 */
1069 XTSE0110,
1070
1071 /**
1072 * An xsl:stylesheet element must not have any text node children.
1073 */
1074 XTSE0120,
1075
1076 /**
1077 * It is a static error if the value of an [xsl:]default-collation
1078 * attribute, after resolving against the base URI, contains no
1079 * URI that the implementation recognizes as a collation URI.
1080 */
1081 XTSE0125,
1082
1083 /**
1084 * It is a static error if the xsl:stylesheet element has a child
1085 * element whose name has a null namespace URI.
1086 */
1087 XTSE0130,
1088
1089 /**
1090 * A literal result element that is used as the outermost element
1091 * of a simplified stylesheet module must have an xsl:version attribute.
1092 */
1093 XTSE0150,
1094
1095 /**
1096 * It is a static error if the processor is not able to retrieve
1097 * the resource identified by the URI reference [ in the href attribute
1098 * of xsl:include or xsl:import] , or if the resource that is retrieved
1099 * does not contain a stylesheet module conforming to this specification.
1100 */
1101 XTSE0165,
1102
1103 /**
1104 * An xsl:include element must be a top-level element.
1105 */
1106 XTSE0170,
1107
1108 /**
1109 * It is a static error if a stylesheet module directly or indirectly
1110 * includes itself.
1111 */
1112 XTSE0180,
1113
1114 /**
1115 * An xsl:import element must be a top-level element.
1116 */
1117 XTSE0190,
1118
1119 /**
1120 * The xsl:import element children must precede all other element
1121 * children of an xsl:stylesheet element, including any xsl:include
1122 * element children and any user-defined data elements.
1123 */
1124 XTSE0200,
1125
1126 /**
1127 * It is a static error if a stylesheet module directly or indirectly
1128 * imports itself.
1129 */
1130 XTSE0210,
1131
1132 /**
1133 * It is a static error if an xsl:import-schema element that contains
1134 * an xs:schema element has a schema-location attribute, or if it
1135 * has a namespace attribute that conflicts with the target namespace
1136 * of the contained schema.
1137 */
1138 XTSE0215,
1139
1140 /**
1141 * It is a static error if the synthetic schema document does not
1142 * satisfy the constraints described in [XML Schema Part 1] (section
1143 * 5.1, Errors in Schema Construction and Structure). This includes,
1144 * without loss of generality, conflicts such as multiple definitions
1145 * of the same name.
1146 */
1147 XTSE0220,
1148
1149 /**
1150 * Within an XSLT element that is required to be empty, any content
1151 * other than comments or processing instructions, including any
1152 * whitespace text node preserved using the xml:space="preserve"
1153 * attribute, is a static error.
1154 */
1155 XTSE0260,
1156
1157 /**
1158 * It is a static error if there is a stylesheet module in the stylesheet
1159 * that specifies input-type-annotations="strip" and another stylesheet
1160 * module that specifies input-type-annotations="preserve".
1161 */
1162 XTSE0265,
1163
1164 /**
1165 * In the case of a prefixed QName used as the value of an attribute
1166 * in the stylesheet, or appearing within an XPath expression in
1167 * the stylesheet, it is a static error if the defining element
1168 * has no namespace node whose name matches the prefix of the QName.
1169 */
1170 XTSE0280,
1171
1172 /**
1173 * Where an attribute is defined to contain a pattern, it is a static
1174 * error if the pattern does not match the production Pattern.
1175 */
1176 XTSE0340,
1177
1178 /**
1179 * It is a static error if an unescaped left curly bracket appears
1180 * in a fixed part of an attribute value template without a matching
1181 * right curly bracket.
1182 */
1183 XTSE0350,
1184
1185 /**
1186 * It is a static error if an unescaped right curly bracket occurs
1187 * in a fixed part of an attribute value template.
1188 */
1189 XTSE0370,
1190
1191 /**
1192 * An xsl:template element must have either a match attribute or
1193 * a name attribute, or both. An xsl:template element that has no
1194 * match attribute must have no mode attribute and no priority attribute.
1195 */
1196 XTSE0500,
1197
1198 /**
1199 * The value of this attribute [the priority attribute of the xsl:template
1200 * element] must conform to the rules for the xs:decimal type defined
1201 * in [XML Schema Part 2]. Negative values are permitted..
1202 */
1203 XTSE0530,
1204
1205 /**
1206 * It is a static error if the list [of modes in the mode attribute
1207 * of xsl:template] is empty, if the same token is included more
1208 * than once in the list, if the list contains an invalid token,
1209 * or if the token \#all appears together with any other value.
1210 */
1211 XTSE0550,
1212
1213 /**
1214 * It is a static error if two parameters of a template or of a
1215 * stylesheet function have the same name.
1216 */
1217 XTSE0580,
1218
1219 /**
1220 * It is a static error if a variable-binding element has a select
1221 * attribute and has non-empty content.
1222 */
1223 XTSE0620,
1224
1225 /**
1226 * It is a static error if a stylesheet contains more than one binding
1227 * of a global variable with the same name and same import precedence,
1228 * unless it also contains another binding with the same name and
1229 * higher import precedence.
1230 */
1231 XTSE0630,
1232
1233 /**
1234 * It is a static error if a stylesheet contains an xsl:call-template
1235 * instruction whose name attribute does not match the name attribute
1236 * of any xsl:template in the stylesheet.
1237 */
1238 XTSE0650,
1239
1240 /**
1241 * It is a static error if a stylesheet contains more than one template
1242 * with the same name and the same import precedence, unless it
1243 * also contains a template with the same name and higher import
1244 * precedence.
1245 */
1246 XTSE0660,
1247
1248 /**
1249 * It is a static error if a single xsl:call-template, xsl:apply-templates,
1250 * xsl:apply-imports, or xsl:next-match element contains two or
1251 * more xsl:with-param elements with matching name attributes.
1252 */
1253 XTSE0670,
1254
1255 /**
1256 * In the case of xsl:call-template, it is a static error to pass
1257 * a non-tunnel parameter named x to a template that does not have
1258 * a template parameter named x, unless backwards compatible behavior
1259 * is enabled for the xsl:call-template instruction.
1260 */
1261 XTSE0680,
1262
1263 /**
1264 * It is a static error if a template that is invoked using xsl:call-template
1265 * declares a template parameter specifying required="yes" and not
1266 * specifying tunnel="yes", if no value for this parameter is supplied
1267 * by the calling instruction.
1268 */
1269 XTSE0690,
1270
1271 /**
1272 * It is a static error if the value of the use-attribute-sets attribute
1273 * of an xsl:copy, xsl:element, or xsl:attribute-set element, or
1274 * the xsl:use-attribute-sets attribute of a literal result element,
1275 * is not a whitespace-separated sequence of QNames, or if it contains
1276 * a QName that does not match the name attribute of any xsl:attribute-set
1277 * declaration in the stylesheet.
1278 */
1279 XTSE0710,
1280
1281 /**
1282 * It is a static error if an xsl:attribute-set element directly
1283 * or indirectly references itself via the names contained in the
1284 * use-attribute-sets attribute.
1285 */
1286 XTSE0720,
1287
1288 /**
1289 * A stylesheet function must have a prefixed name, to remove any
1290 * risk of a clash with a function in the default function namespace.
1291 * It is a static error if the name has no prefix.
1292 */
1293 XTSE0740,
1294
1295 /**
1296 * Because arguments to a stylesheet function call must all be specified,
1297 * the xsl:param elements within an xsl:function element must not
1298 * specify a default value: this means they must be empty, and must
1299 * not have a select attribute.
1300 */
1301 XTSE0760,
1302
1303 /**
1304 * It is a static error for a stylesheet to contain two or more
1305 * functions with the same expanded-QName, the same arity, and the
1306 * same import precedence, unless there is another function with
1307 * the same expanded-QName and arity, and a higher import precedence.
1308 */
1309 XTSE0770,
1310
1311 /**
1312 * It is a static error if an attribute on a literal result element
1313 * is in the XSLT namespace, unless it is one of the attributes
1314 * explicitly defined in this specification.
1315 */
1316 XTSE0805,
1317
1318 /**
1319 * It is a static error if a namespace prefix is used within the
1320 * [xsl:]exclude-result-prefixes attribute and there is no namespace
1321 * binding in scope for that prefix.
1322 */
1323 XTSE0808,
1324
1325 /**
1326 * It is a static error if the value \#default is used within the
1327 * [xsl:]exclude-result-prefixes attribute and the parent element
1328 * of the [xsl:]exclude-result-prefixes attribute has no default
1329 * namespace.
1330 */
1331 XTSE0809,
1332
1333 /**
1334 * It is a static error if there is more than one such declaration
1335 * [more than one xsl:namespace-alias declaration] with the same
1336 * literal namespace URI and the same import precedence and different
1337 * values for the target namespace URI, unless there is also an
1338 * xsl:namespace-alias declaration with the same literal namespace
1339 * URI and a higher import precedence.
1340 */
1341 XTSE0810,
1342
1343 /**
1344 * It is a static error if a value other than \#default is specified
1345 * for either the stylesheet-prefix or the result-prefix attributes
1346 * of the xsl:namespace-alias element when there is no in-scope
1347 * binding for that namespace prefix.
1348 */
1349 XTSE0812,
1350
1351 /**
1352 * It is a static error if the select attribute of the xsl:attribute
1353 * element is present unless the element has empty content.
1354 */
1355 XTSE0840,
1356
1357 /**
1358 * It is a static error if the select attribute of the xsl:value-of
1359 * element is present when the content of the element is non-empty,
1360 * or if the select attribute is absent when the content is empty.
1361 */
1362 XTSE0870,
1363
1364 /**
1365 * It is a static error if the select attribute of the xsl:processing-instruction
1366 * element is present unless the element has empty content.
1367 */
1368 XTSE0880,
1369
1370 /**
1371 * It is a static error if the select attribute of the xsl:namespace
1372 * element is present when the element has content other than one
1373 * or more xsl:fallback instructions, or if the select attribute
1374 * is absent when the element has empty content.
1375 */
1376 XTSE0910,
1377
1378 /**
1379 * It is a static error if the select attribute of the xsl:comment
1380 * element is present unless the element has empty content.
1381 */
1382 XTSE0940,
1383
1384 /**
1385 * It is a type error to use the xsl:copy or xsl:copy-of instruction
1386 * to copy a node that has namespace-sensitive content if the copy-namespaces
1387 * attribute has the value no and its explicit or implicit validation
1388 * attribute has the value preserve. It is also a type error if
1389 * either of these instructions (with validation="preserve") is
1390 * used to copy an attribute having namespace-sensitive content,
1391 * unless the parent element is also copied. A node has namespace-sensitive
1392 * content if its typed value contains an item of type xs:QName
1393 * or xs:NOTATION or a type derived therefrom. The reason this is
1394 * an error is because the validity of the content depends on the
1395 * namespace context being preserved.
1396 */
1397 XTTE0950,
1398
1399 /**
1400 * It is a static error if the value attribute of xsl:number is
1401 * present unless the select, level, count, and from attributes
1402 * are all absent.
1403 */
1404 XTSE0975,
1405
1406 /**
1407 * It is a static error if an xsl:sort element with a select attribute
1408 * has non-empty content.
1409 */
1410 XTSE1015,
1411
1412 /**
1413 * It is a static error if an xsl:sort element other than the first
1414 * in a sequence of sibling xsl:sort elements has a stable attribute.
1415 */
1416 XTSE1017,
1417
1418 /**
1419 * It is a static error if an xsl:perform-sort instruction with
1420 * a select attribute has any content other than xsl:sort and xsl:fallback
1421 * instructions.
1422 */
1423 XTSE1040,
1424
1425 /**
1426 * It is a static error if the current-group function is used within
1427 * a pattern.
1428 */
1429 XTSE1060,
1430
1431 /**
1432 * It is a static error if the current-grouping-key function is
1433 * used within a pattern.
1434 */
1435 XTSE1070,
1436
1437 /**
1438 * These four attributes [the group-by, group-adjacent, group-starting-with,
1439 * and group-ending-with attributes of xsl:for-each-group ] are
1440 * mutually exclusive: it is a static error if none of these four
1441 * attributes is present, or if more than one of them is present.
1442 */
1443 XTSE1080,
1444
1445 /**
1446 * It is an error to specify the collation attribute if neither
1447 * the group-by attribute nor group-adjacent attribute is specified.
1448 */
1449 XTSE1090,
1450
1451 /**
1452 * It is a static error if the xsl:analyze-string instruction contains
1453 * neither an xsl:matching-substring nor an xsl:non-matching-substring
1454 * element.
1455 */
1456 XTSE1130,
1457
1458 /**
1459 * It is a static error if an xsl:key declaration has a use attribute
1460 * and has non-empty content, or if it has empty content and no
1461 * use attribute.
1462 */
1463 XTSE1205,
1464
1465 /**
1466 * It is a static error if the xsl:key declaration has a collation
1467 * attribute whose value (after resolving against the base URI)
1468 * is not a URI recognized by the implementation as referring to
1469 * a collation.
1470 */
1471 XTSE1210,
1472
1473 /**
1474 * It is a static error if there are several xsl:key declarations
1475 * in the stylesheet with the same key name and different effective
1476 * collations. Two collations are the same if their URIs are equal
1477 * under the rules for comparing xs:anyURI values, or if the implementation
1478 * can determine that they are different URIs referring to the same
1479 * collation.
1480 */
1481 XTSE1220,
1482
1483 /**
1484 * It is a static error if a named or unnamed decimal format contains
1485 * two conflicting values for the same attribute in different xsl:decimal-format
1486 * declarations having the same import precedence, unless there
1487 * is another definition of the same attribute with higher import
1488 * precedence.
1489 */
1490 XTSE1290,
1491
1492 /**
1493 * It is a static error if the character specified in the zero-digit
1494 * attribute is not a digit or is a digit that does not have the
1495 * numeric value zero.
1496 */
1497 XTSE1295,
1498
1499 /**
1500 * It is a static error if, for any named or unnamed decimal format,
1501 * the variables representing characters used in a picture string
1502 * do not each have distinct values. These variables are decimal-separator-sign,
1503 * grouping-sign, percent-sign, per-mille-sign, digit-zero-sign,
1504 * digit-sign, and pattern-separator-sign.
1505 */
1506 XTSE1300,
1507
1508 /**
1509 * It is a static error if there is no namespace bound to the prefix
1510 * on the element bearing the [xsl:]extension-element-prefixes attribute
1511 * or, when \#default is specified, if there is no default namespace.
1512 */
1513 XTSE1430,
1514
1515 /**
1516 * It is a static error if both the [xsl:]type and [xsl:]validation
1517 * attributes are present on the xsl:element, xsl:attribute, xsl:copy,
1518 * xsl:copy-of, xsl:document, or xsl:result-document instructions,
1519 * or on a literal result element.
1520 */
1521 XTSE1505,
1522
1523 /**
1524 * It is a static error if the value of the type attribute of an
1525 * xsl:element, xsl:attribute, xsl:copy, xsl:copy-of, xsl:document,
1526 * or xsl:result-document instruction, or the xsl:type attribute
1527 * of a literal result element, is not a valid QName, or if it uses
1528 * a prefix that is not defined in an in-scope namespace declaration,
1529 * or if the QName is not the name of a type definition included
1530 * in the in-scope schema components for the stylesheet.
1531 */
1532 XTSE1520,
1533
1534 /**
1535 * It is a static error if the value of the type attribute of an
1536 * xsl:attribute instruction refers to a complex type definition
1537 */
1538 XTSE1530,
1539
1540 /**
1541 * It is a static error if two xsl:output declarations within an
1542 * output definition specify explicit values for the same attribute
1543 * (other than cdata-section-elements and use-character-maps), with
1544 * the values of the attributes being not equal, unless there is
1545 * another xsl:output declaration within the same output definition
1546 * that has higher import precedence and that specifies an explicit
1547 * value for the same attribute.
1548 */
1549 XTSE1560,
1550
1551 /**
1552 * The value [of the method attribute on xsl:output ] must (if present)
1553 * be a valid QName. If the QName does not have a prefix, then it
1554 * identifies a method specified in [XSLT and XQuery Serialization]
1555 * and must be one of xml, html, xhtml, or text.
1556 */
1557 XTSE1570,
1558
1559 /**
1560 * It is a static error if the stylesheet contains two or more character
1561 * maps with the same name and the same import precedence, unless
1562 * it also contains another character map with the same name and
1563 * higher import precedence.
1564 */
1565 XTSE1580,
1566
1567 /**
1568 * It is a static error if a name in the use-character-maps attribute
1569 * of the xsl:output or xsl:character-map elements does not match
1570 * the name attribute of any xsl:character-map in the stylesheet.
1571 */
1572 XTSE1590,
1573
1574 /**
1575 * It is a static error if a character map references itself, directly
1576 * or indirectly, via a name in the use-character-maps attribute.
1577 */
1578 XTSE1600,
1579
1580 /**
1581 * A basic XSLT processor must signal a static error if the stylesheet
1582 * includes an xsl:import-schema declaration.
1583 */
1584 XTSE1650,
1585
1586 /**
1587 * A basic XSLT processor must signal a static error if the stylesheet
1588 * includes an [xsl:]type attribute, or an [xsl:]validation or default-validation
1589 * attribute with a value other than strip.
1590 */
1591 XTSE1660,
1592
1593 /**
1594 * It is a type error if the result of evaluating the sequence constructor
1595 * cannot be converted to the required type.
1596 */
1597 XTTE0505,
1598
1599 /**
1600 * It is a type error if an xsl:apply-templates instruction with
1601 * no select attribute is evaluated when the context item is not
1602 * a node.
1603 */
1604 XTTE0510,
1605
1606 /**
1607 * It is a type error if the sequence returned by the select expression
1608 * [of xsl:apply-templates] contains an item that is not a node.
1609 */
1610 XTTE0520,
1611
1612 /**
1613 * It is a type error if the supplied value of a variable cannot
1614 * be converted to the required type.
1615 */
1616 XTTE0570,
1617
1618 /**
1619 * It is a type error if the conversion of the supplied value of
1620 * a parameter to its required type fails.
1621 */
1622 XTTE0590,
1623
1624 /**
1625 * If a default value is given explicitly, that is, if there is
1626 * either a select attribute or a non-empty sequence constructor,
1627 * then it is a type error if the default value cannot be converted
1628 * to the required type, using the function conversion rules.
1629 */
1630 XTTE0600,
1631
1632 /**
1633 * If the as attribute [of xsl:function ] is specified, then the
1634 * result evaluated by the sequence constructor (see 5.7 Sequence
1635 * Constructors) is converted to the required type, using the function
1636 * conversion rules. It is a type error if this conversion fails.
1637 */
1638 XTTE0780,
1639
1640 /**
1641 * If the value of a parameter to a stylesheet function cannot be
1642 * converted to the required type, a type error is signaled.
1643 */
1644 XTTE0790,
1645
1646 /**
1647 * It is a type error if the xsl:number instruction is evaluated,
1648 * with no value or select attribute, when the context item is not
1649 * a node.
1650 */
1651 XTTE0990,
1652
1653 /**
1654 * It is a type error if the result of evaluating the select attribute
1655 * of the xsl:number instruction is anything other than a single
1656 * node.
1657 */
1658 XTTE1000,
1659
1660 /**
1661 * If any sort key value, after atomization and any type conversion
1662 * required by the data-type attribute, is a sequence containing
1663 * more than one item, then the effect depends on whether the xsl:sort
1664 * element is evaluated with backwards compatible behavior. With
1665 * backwards compatible behavior, the effective sort key value is
1666 * the first item in the sequence. In other cases, this is a type
1667 * error.
1668 */
1669 XTTE1020,
1670
1671 /**
1672 * It is a type error if the grouping key evaluated using the group-adjacent
1673 * attribute is an empty sequence, or a sequence containing more
1674 * than one item.
1675 */
1676 XTTE1100,
1677
1678 /**
1679 * When the group-starting-with or group-ending-with attribute [of
1680 * the xsl:for-each-group instruction] is used, it is a type error
1681 * if the result of evaluating the select expression contains an
1682 * item that is not a node.
1683 */
1684 XTTE1120,
1685
1686 /**
1687 * If the validation attribute of an xsl:element, xsl:attribute,
1688 * xsl:copy, xsl:copy-of, or xsl:result-document instruction, or
1689 * the xsl:validation attribute of a literal result element, has
1690 * the effective value strict, and schema validity assessment concludes
1691 * that the validity of the element or attribute is invalid or unknown,
1692 * a type error occurs. As with other type errors, the error may
1693 * be signaled statically if it can be detected statically.
1694 */
1695 XTTE1510,
1696
1697 /**
1698 * If the validation attribute of an xsl:element, xsl:attribute,
1699 * xsl:copy, xsl:copy-of, or xsl:result-document instruction, or
1700 * the xsl:validation attribute of a literal result element, has
1701 * the effective value strict, and there is no matching top-level
1702 * declaration in the schema, then a type error occurs. As with
1703 * other type errors, the error may be signaled statically if it
1704 * can be detected statically.
1705 */
1706 XTTE1512,
1707
1708 /**
1709 * If the validation attribute of an xsl:element, xsl:attribute,
1710 * xsl:copy, xsl:copy-of, or xsl:result-document instruction, or
1711 * the xsl:validation attribute of a literal result element, has
1712 * the effective value lax, and schema validity assessment concludes
1713 * that the element or attribute is invalid, a type error occurs.
1714 * As with other type errors, the error may be signaled statically
1715 * if it can be detected statically.
1716 */
1717 XTTE1515,
1718
1719 /**
1720 * It is a type error if an [xsl:]type attribute is defined for
1721 * a constructed element or attribute, and the outcome of schema
1722 * validity assessment against that type is that the validity property
1723 * of that element or attribute information item is other than valid.
1724 */
1725 XTTE1540,
1726
1727 /**
1728 * A type error occurs if a type or validation attribute is defined
1729 * (explicitly or implicitly) for an instruction that constructs
1730 * a new attribute node, if the effect of this is to cause the attribute
1731 * value to be validated against a type that is derived from, or
1732 * constructed by list or union from, the primitive types xs:QName
1733 * or xs:NOTATION.
1734 */
1735 XTTE1545,
1736
1737 /**
1738 * A type error occurs [when a document node is validated] unless
1739 * the children of the document node comprise exactly one element
1740 * node, no text nodes, and zero or more comment and processing
1741 * instruction nodes, in any order.
1742 */
1743 XTTE1550,
1744
1745 /**
1746 * It is a type error if, when validating a document node, document-level
1747 * constraints are not satisfied. These constraints include identity
1748 * constraints (xs:unique, xs:key, and xs:keyref) and ID/IDREF constraints.
1749 */
1750 XTTE1555,
1751
1752 /**
1753 * It is a non-recoverable dynamic error if the effective value
1754 * of an attribute written using curly brackets, in a position where
1755 * an attribute value template is permitted, is a value that is
1756 * not one of the permitted values for that attribute. If the processor
1757 * is able to detect the error statically (for example, when any
1758 * XPath expressions within the curly brackets can be evaluated
1759 * statically), then the processor may optionally signal this as
1760 * a static error.
1761 */
1762 XTDE0030,
1763
1764 /**
1765 * It is a non-recoverable dynamic error if the invocation of the
1766 * stylesheet specifies a template name that does not match the
1767 * expanded-QName of a named template defined in the stylesheet.
1768 */
1769 XTDE0040,
1770
1771 /**
1772 * It is a non-recoverable dynamic error if the invocation of the
1773 * stylesheet specifies an initial mode (other than the default
1774 * mode) that does not match the expanded-QName in the mode attribute
1775 * of any template defined in the stylesheet.
1776 */
1777 XTDE0045,
1778
1779 /**
1780 * It is a non-recoverable dynamic error if the invocation of the
1781 * stylesheet specifies both an initial mode and an initial template.
1782 */
1783 XTDE0047,
1784
1785 /**
1786 * It is a non-recoverable dynamic error if the stylesheet that
1787 * is invoked declares a visible stylesheet parameter with required="yes"
1788 * and no value for this parameter is supplied during the invocation
1789 * of the stylesheet. A stylesheet parameter is visible if it is
1790 * not masked by another global variable or parameter with the same
1791 * name and higher import precedence.
1792 */
1793 XTDE0050,
1794
1795 /**
1796 * It is a non-recoverable dynamic error if the initial template
1797 * defines a template parameter that specifies required="yes".
1798 */
1799 XTDE0060,
1800
1801 /**
1802 * If an implementation does not support backwards-compatible behavior,
1803 * then it is a non-recoverable dynamic error if any element is
1804 * evaluated that enables backwards-compatible behavior.
1805 */
1806 XTDE0160,
1807
1808 /**
1809 * It is a recoverable dynamic error if this [the process of finding
1810 * an xsl:strip-space or xsl:preserve-space declaration to match
1811 * an element in the source document] leaves more than one match,
1812 * unless all the matched declarations are equivalent (that is,
1813 * they are all xsl:strip-space or they are all xsl:preserve-space).
1814 * Action: The optional recovery action is to select, from the matches
1815 * that are left, the one that occurs last in declaration order.
1816 */
1817 XTRE0270,
1818
1819 /**
1820 * Where the result of evaluating an XPath expression (or an attribute
1821 * value template) is required to be a lexical QName, then unless
1822 * otherwise specified it is a non-recoverable dynamic error if
1823 * the defining element has no namespace node whose name matches
1824 * the prefix of the lexical QName. This error may be signaled as
1825 * a static error if the value of the expression can be determined
1826 * statically.
1827 */
1828 XTDE0290,
1829
1830 /**
1831 * It is a non-recoverable dynamic error if the result sequence
1832 * used to construct the content of an element node contains a namespace
1833 * node or attribute node that is preceded in the sequence by a
1834 * node that is neither a namespace node nor an attribute node.
1835 */
1836 XTDE0410,
1837
1838 /**
1839 * It is a non-recoverable dynamic error if the result sequence
1840 * used to construct the content of a document node contains a namespace
1841 * node or attribute node.
1842 */
1843 XTDE0420,
1844
1845 /**
1846 * It is a non-recoverable dynamic error if the result sequence
1847 * contains two or more namespace nodes having the same name but
1848 * different string values (that is, namespace nodes that map the
1849 * same prefix to different namespace URIs).
1850 */
1851 XTDE0430,
1852
1853 /**
1854 * It is a non-recoverable dynamic error if the result sequence
1855 * contains a namespace node with no name and the element node being
1856 * constructed has a null namespace URI (that is, it is an error
1857 * to define a default namespace when the element is in no namespace).
1858 */
1859 XTDE0440,
1860
1861 /**
1862 * It is a non-recoverable dynamic error if namespace fixup is performed
1863 * on an element that contains among the typed values of the element
1864 * and its attributes two values of type xs:QName or xs:NOTATION
1865 * containing conflicting namespace prefixes, that is, two values
1866 * that use the same prefix to refer to different namespace URIs.
1867 */
1868 XTDE0485,
1869
1870 /**
1871 * It is a recoverable dynamic error if the conflict resolution
1872 * algorithm for template rules leaves more than one matching template
1873 * rule. Action: The optional recovery action is to select, from
1874 * the matching template rules that are left, the one that occurs
1875 * last in declaration order.
1876 */
1877 XTRE0540,
1878
1879 /**
1880 * It is a non-recoverable dynamic error if xsl:apply-imports or
1881 * xsl:next-match is evaluated when the current template rule is
1882 * null.
1883 */
1884 XTDE0560,
1885
1886 /**
1887 * If an optional parameter has no select attribute and has an empty
1888 * sequence constructor, and if there is an as attribute, then the
1889 * default value of the parameter is an empty sequence. If the empty
1890 * sequence is not a valid instance of the required type defined
1891 * in the as attribute, then the parameter is treated as a required
1892 * parameter, which means that it is a non-recoverable dynamic error
1893 * if the caller supplies no value for the parameter.
1894 */
1895 XTDE0610,
1896
1897 /**
1898 * In general, a circularity in a stylesheet is a non-recoverable
1899 * dynamic error.
1900 */
1901 XTDE0640,
1902
1903 /**
1904 * In other cases, [with xsl:apply-templates, xsl:apply-imports,
1905 * and xsl:next-match, or xsl:call-template with tunnel parameters]
1906 * it is a non-recoverable dynamic error if the template that is
1907 * invoked declares a template parameter with required="yes" and
1908 * no value for this parameter is supplied by the calling instruction.
1909 */
1910 XTDE0700,
1911
1912 /**
1913 * It is a recoverable dynamic error if the name of a constructed
1914 * attribute is xml:space and the value is not either default or
1915 * preserve. Action: The optional recovery action is to construct
1916 * the attribute with the value as requested.
1917 */
1918 XTRE0795,
1919
1920 /**
1921 * It is a non-recoverable dynamic error if the effective value
1922 * of the name attribute [of the xsl:element instruction] is not
1923 * a lexical QName.
1924 */
1925 XTDE0820,
1926
1927 /**
1928 * In the case of an xsl:element instruction with no namespace attribute,
1929 * it is a non-recoverable dynamic error if the effective value
1930 * of the name attribute is a QName whose prefix is not declared
1931 * in an in-scope namespace declaration for the xsl:element instruction.
1932 */
1933 XTDE0830,
1934
1935 /**
1936 * It is a non-recoverable dynamic error if the effective value
1937 * of the namespace attribute [of the xsl:element instruction] is
1938 * not in the lexical space of the xs:anyURI data type.
1939 */
1940 XTDE0835,
1941
1942 /**
1943 * It is a non-recoverable dynamic error if the effective value
1944 * of the name attribute [of an xsl:attribute instruction] is not
1945 * a lexical QName.
1946 */
1947 XTDE0850,
1948
1949 /**
1950 * In the case of an xsl:attribute instruction with no namespace
1951 * attribute, it is a non-recoverable dynamic error if the effective
1952 * value of the name attribute is the string xmlns.
1953 */
1954 XTDE0855,
1955
1956 /**
1957 * In the case of an xsl:attribute instruction with no namespace
1958 * attribute, it is a non-recoverable dynamic error if the effective
1959 * value of the name attribute is a lexical QName whose prefix is
1960 * not declared in an in-scope namespace declaration for the xsl:attribute
1961 * instruction.
1962 */
1963 XTDE0860,
1964
1965 /**
1966 * It is a non-recoverable dynamic error if the effective value
1967 * of the namespace attribute [of the xsl:attribute instruction]
1968 * is not in the lexical space of the xs:anyURI data type.
1969 */
1970 XTDE0865,
1971
1972 /**
1973 * It is a non-recoverable dynamic error if the effective value
1974 * of the name attribute [of the xsl:processing-instruction instruction]
1975 * is not both an NCName Names and a PITarget XML.
1976 */
1977 XTDE0890,
1978
1979 /**
1980 * It is a non-recoverable dynamic error if the string value of
1981 * the new namespace node [created using xsl:namespace] is not valid
1982 * in the lexical space of the data type xs:anyURI. [see ERR XTDE0835]
1983 */
1984 XTDE0905,
1985
1986 /**
1987 * It is a non-recoverable dynamic error if the effective value
1988 * of the name attribute [of the xsl:namespace instruction] is neither
1989 * a zero-length string nor an NCName Names, or if it is xmlns.
1990 */
1991 XTDE0920,
1992
1993 /**
1994 * It is a non-recoverable dynamic error if the xsl:namespace instruction
1995 * generates a namespace node whose name is xml and whose string
1996 * value is not http://www.w3.org/XML/1998/namespace, or a namespace
1997 * node whose string value is http://www.w3.org/XML/1998/namespace
1998 * and whose name is not xml.
1999 */
2000 XTDE0925,
2001
2002 /**
2003 * It is a non-recoverable dynamic error if evaluating the select
2004 * attribute or the contained sequence constructor of an xsl:namespace
2005 * instruction results in a zero-length string.
2006 */
2007 XTDE0930,
2008
2009 /**
2010 * It is a non-recoverable dynamic error if any undiscarded item
2011 * in the atomized sequence supplied as the value of the value attribute
2012 * of xsl:number cannot be converted to an integer, or if the resulting
2013 * integer is less than 0 (zero).
2014 */
2015 XTDE0980,
2016
2017 /**
2018 * It is a non-recoverable dynamic error if, for any sort key component,
2019 * the set of sort key values evaluated for all the items in the
2020 * initial sequence, after any type conversion requested, contains
2021 * a pair of ordinary values for which the result of the XPath lt
2022 * operator is an error.
2023 */
2024 XTDE1030,
2025
2026 /**
2027 * It is a non-recoverable dynamic error if the collation attribute
2028 * of xsl:sort (after resolving against the base URI) is not a URI
2029 * that is recognized by the implementation as referring to a collation.
2030 */
2031 XTDE1035,
2032
2033 /**
2034 * It is a non-recoverable dynamic error if the collation URI specified
2035 * to xsl:for-each-group (after resolving against the base URI)
2036 * is a collation that is not recognized by the implementation.
2037 * (For notes, [see ERR XTDE1035].)
2038 */
2039 XTDE1110,
2040
2041 /**
2042 * It is a non-recoverable dynamic error if the effective value
2043 * of the regex attribute [of the xsl:analyze-string instruction]
2044 * does not conform to the required syntax for regular expressions,
2045 * as specified in [Functions and Operators]. If the regular expression
2046 * is known statically (for example, if the attribute does not contain
2047 * any expressions enclosed in curly brackets) then the processor
2048 * may signal the error as a static error.
2049 */
2050 XTDE1140,
2051
2052 /**
2053 * It is a non-recoverable dynamic error if the effective value
2054 * of the flags attribute [of the xsl:analyze-string instruction]
2055 * has a value other than the values defined in [Functions and Operators].
2056 * If the value of the attribute is known statically (for example,
2057 * if the attribute does not contain any expressions enclosed in
2058 * curly brackets) then the processor may signal the error as a
2059 * static error.
2060 */
2061 XTDE1145,
2062
2063 /**
2064 * It is a non-recoverable dynamic error if the effective value
2065 * of the regex attribute [of the xsl:analyze-string instruction]
2066 * is a regular expression that matches a zero-length string: or
2067 * more specifically, if the regular expression $r and flags $f
2068 * are such that matches("", $r, $f) returns true. If the regular
2069 * expression is known statically (for example, if the attribute
2070 * does not contain any expressions enclosed in curly brackets)
2071 * then the processor may signal the error as a static error.
2072 */
2073 XTDE1150,
2074
2075 /**
2076 * When a URI reference [supplied to the document function] contains
2077 * a fragment identifier, it is a recoverable dynamic error if the
2078 * media type is not one that is recognized by the processor, or
2079 * if the fragment identifier does not conform to the rules for
2080 * fragment identifiers for that media type, or if the fragment
2081 * identifier selects something other than a sequence of nodes (for
2082 * example, if it selects a range of characters within a text node).
2083 * Action: The optional recovery action is to ignore the fragment
2084 * identifier and return the document node.
2085 */
2086 XTRE1160,
2087
2088 /**
2089 * It is a non-recoverable dynamic error if a URI [supplied in the
2090 * first argument to the unparsed-text function] contains a fragment
2091 * identifier, or if it cannot be used to retrieve a resource containing
2092 * text.
2093 */
2094 XTDE1170,
2095
2096 /**
2097 * It is a non-recoverable dynamic error if a resource [retrieved
2098 * using the unparsed-text function] contains octets that cannot
2099 * be decoded into Unicode characters using the specified encoding,
2100 * or if the resulting characters are not permitted XML characters.
2101 * This includes the case where the processor does not support the
2102 * requested encoding.
2103 */
2104 XTDE1190,
2105
2106 /**
2107 * It is a non-recoverable dynamic error if the second argument
2108 * of the unparsed-text function is omitted and the processor cannot
2109 * infer the encoding using external information and the encoding
2110 * is not UTF-8.
2111 */
2112 XTDE1200,
2113
2114 /**
2115 * It is a non-recoverable dynamic error if the value [of the first
2116 * argument to the key function] is not a valid QName, or if there
2117 * is no namespace declaration in scope for the prefix of the QName,
2118 * or if the name obtained by expanding the QName is not the same
2119 * as the expanded name of any xsl:key declaration in the stylesheet.
2120 * If the processor is able to detect the error statically (for
2121 * example, when the argument is supplied as a string literal),
2122 * then the processor may optionally signal this as a static error.
2123 */
2124 XTDE1260,
2125
2126 /**
2127 * It is a non-recoverable dynamic error to call the key function
2128 * with two arguments if there is no context node, or if the root
2129 * of the tree containing the context node is not a document node;
2130 * or to call the function with three arguments if the root of the
2131 * tree containing the node supplied in the third argument is not
2132 * a document node.
2133 */
2134 XTDE1270,
2135
2136 /**
2137 * It is a non-recoverable dynamic error if the name specified as
2138 * the $decimal-format-name argument [ to the format-number function]
2139 * is not a valid QName, or if its prefix has not been declared
2140 * in an in-scope namespace declaration, or if the stylesheet does
2141 * not contain a declaration of a decimal-format with a matching
2142 * expanded-QName. If the processor is able to detect the error
2143 * statically (for example, when the argument is supplied as a string
2144 * literal), then the processor may optionally signal this as a
2145 * static error.
2146 */
2147 XTDE1280,
2148
2149 /**
2150 * The picture string [supplied to the format-number function] must
2151 * conform to the following rules. [ See full specification.] It
2152 * is a non-recoverable dynamic error if the picture string does
2153 * not satisfy these rules.
2154 */
2155 XTDE1310,
2156
2157 /**
2158 * It is a non-recoverable dynamic error if the syntax of the picture
2159 * [used for date/time formatting] is incorrect.
2160 */
2161 XTDE1340,
2162
2163 /**
2164 * It is a non-recoverable dynamic error if a component specifier
2165 * within the picture [used for date/time formatting] refers to
2166 * components that are not available in the given type of $value,
2167 * for example if the picture supplied to the format-time refers
2168 * to the year, month, or day component.
2169 */
2170 XTDE1350,
2171
2172 /**
2173 * If the current function is evaluated within an expression that
2174 * is evaluated when the context item is undefined, a non-recoverable
2175 * dynamic error occurs.
2176 */
2177 XTDE1360,
2178
2179 /**
2180 * It is a non-recoverable dynamic error if the unparsed-entity-uri
2181 * function is called when there is no context node, or when the
2182 * root of the tree containing the context node is not a document
2183 * node.
2184 */
2185 XTDE1370,
2186
2187 /**
2188 * It is a non-recoverable dynamic error if the unparsed-entity-public-id
2189 * function is called when there is no context node, or when the
2190 * root of the tree containing the context node is not a document
2191 * node.
2192 */
2193 XTDE1380,
2194
2195 /**
2196 * It is a non-recoverable dynamic error if the value [supplied
2197 * as the $property-name argument to the system-property function]
2198 * is not a valid QName, or if there is no namespace declaration
2199 * in scope for the prefix of the QName. If the processor is able
2200 * to detect the error statically (for example, when the argument
2201 * is supplied as a string literal), then the processor may optionally
2202 * signal this as a static error.
2203 */
2204 XTDE1390,
2205
2206 /**
2207 * When a transformation is terminated by use of xsl:message terminate="yes",
2208 * the effect is the same as when a non-recoverable dynamic error
2209 * occurs during the transformation.
2210 */
2211 XTMM9000,
2212
2213 /**
2214 * It is a non-recoverable dynamic error if the argument [passed
2215 * to the function-available function] does not evaluate to a string
2216 * that is a valid QName, or if there is no namespace declaration
2217 * in scope for the prefix of the QName. If the processor is able
2218 * to detect the error statically (for example, when the argument
2219 * is supplied as a string literal), then the processor may optionally
2220 * signal this as a static error.
2221 */
2222 XTDE1400,
2223
2224 /**
2225 * It is a non-recoverable dynamic error if the arguments supplied
2226 * to a call on an extension function do not satisfy the rules defined
2227 * for that particular extension function, or if the extension function
2228 * reports an error, or if the result of the extension function
2229 * cannot be converted to an XPath value.
2230 */
2231 XTDE1420,
2232
2233 /**
2234 * When backwards compatible behavior is enabled, it is a non-recoverable
2235 * dynamic error to evaluate an extension function call if no implementation
2236 * of the extension function is available.
2237 */
2238 XTDE1425,
2239
2240 /**
2241 * It is a non-recoverable dynamic error if the argument [passed
2242 * to the type-available function] does not evaluate to a string
2243 * that is a valid QName, or if there is no namespace declaration
2244 * in scope for the prefix of the QName. If the processor is able
2245 * to detect the error statically (for example, when the argument
2246 * is supplied as a string literal), then the processor may optionally
2247 * signal this as a static error.
2248 */
2249 XTDE1428,
2250
2251 /**
2252 * It is a non-recoverable dynamic error if the argument [passed
2253 * to the element-available function] does not evaluate to a string
2254 * that is a valid QName, or if there is no namespace declaration
2255 * in scope for the prefix of the QName. If the processor is able
2256 * to detect the error statically (for example, when the argument
2257 * is supplied as a string literal), then the processor may optionally
2258 * signal this as a static error.
2259 */
2260 XTDE1440,
2261
2262 /**
2263 * When a processor performs fallback for an extension instruction
2264 * that is not recognized, if the instruction element has one or
2265 * more xsl:fallback children, then the content of each of the xsl:fallback
2266 * children must be evaluated; it is a non-recoverable dynamic error
2267 * if it has no xsl:fallback children.
2268 */
2269 XTDE1450,
2270
2271 /**
2272 * It is a non-recoverable dynamic error if the effective value
2273 * of the format attribute [of an xsl:result-document element] is
2274 * not a valid lexical QName, or if it does not match the expanded-QName
2275 * of an output definition in the stylesheet. If the processor is
2276 * able to detect the error statically (for example, when the format
2277 * attribute contains no curly brackets), then the processor may
2278 * optionally signal this as a static error.
2279 */
2280 XTDE1460,
2281
2282 /**
2283 * It is a non-recoverable dynamic error to evaluate the xsl:result-document
2284 * instruction in temporary output state.
2285 */
2286 XTDE1480,
2287
2288 /**
2289 * It is a non-recoverable dynamic error for a transformation to
2290 * generate two or more final result trees with the same URI.
2291 */
2292 XTDE1490,
2293
2294 /**
2295 * It is a recoverable dynamic error for a transformation to generate
2296 * two or more final result trees with URIs that identify the same
2297 * physical resource. The optional recovery action is implementation-dependent,
2298 * since it may be impossible for the processor to detect the error.
2299 */
2300 XTRE1495,
2301
2302 /**
2303 * It is a recoverable dynamic error for a stylesheet to write to
2304 * an external resource and read from the same resource during a
2305 * single transformation, whether or not the same URI is used to
2306 * access the resource in both cases. Action: The optional recovery
2307 * action is implementation-dependent: implementations are not required
2308 * to detect the error condition. Note that if the error is not
2309 * detected, it is undefined whether the document that is read from
2310 * the resource reflects its state before or after the result tree
2311 * is written.
2312 */
2313 XTRE1500,
2314
2315 /**
2316 * It is a recoverable dynamic error if an xsl:value-of or xsl:text
2317 * instruction specifies that output escaping is to be disabled
2318 * and the implementation does not support this. Action: The optional
2319 * recovery action is to ignore the disable-output-escaping attribute.
2320 */
2321 XTRE1620,
2322
2323 /**
2324 * It is a recoverable dynamic error if an xsl:value-of or xsl:text
2325 * instruction specifies that output escaping is to be disabled
2326 * when writing to a final result tree that is not being serialized.
2327 * Action: The optional recovery action is to ignore the disable-output-escaping
2328 * attribute.
2329 */
2330 XTRE1630,
2331
2332 /**
2333 * A basic XSLT processor must raise a non-recoverable dynamic error
2334 * if the input to the processor includes a node with a type annotation
2335 * other than xs:untyped or xs:untypedAtomic, or an atomic value
2336 * of a type other than those which a basic XSLT processor supports.
2337 */
2338 XTDE1665
2339
2340 };
2341
2342 /**
2343 * Issues a warning, should not be used excessively. This can
2344 * be used to communicate that a certain implementation defined
2345 * feature is unsupported or that a certain expression most likely
2346 * doesn't do what the users wants, to name a few examples.
2347 *
2348 * @see <a href="http://www.w3.org/TR/xpath20/#errors">XML Path Language (XPath) 2.0,
2349 * 2.3 Error Handling</a>
2350 * @param message the message to be read by the user.
2351 * @param sourceLocation the location of where the warning originates from.
2352 */
2353 void warning(const QString &message, const QSourceLocation &sourceLocation = QSourceLocation());
2354
2355 /**
2356 * Issues an error. May be used at the static analysis phase or
2357 * the dynamic evaluation phase.
2358 *
2359 * For SourceLocationReflection instances, the overload taking an SouourceLocationReflection should be used.
2360 *
2361 * @see <a href="http://www.w3.org/TR/xpath20/#errors">XML Path Language (XPath) 2.0,
2362 * 2.3 Error Handling</a>
2363 * @param message the message to be read by the user.
2364 * @param errorCode identifies the error condition, as described
2365 * @param sourceLocation the location of where the error originates from
2366 * in "XML Path Language (XPath) 2.0" section "G Error Conditions"
2367 */
2368 void error(const QString &message,
2369 const ReportContext::ErrorCode errorCode,
2370 const QSourceLocation &sourceLocation);
2371
2372 /**
2373 * Overload.
2374 *
2375 * Same as the above, but passes the SourceLocationReflection as reference for error reporting.
2376 */
2377 void error(const QString &message,
2378 const ReportContext::ErrorCode errorCode,
2379 const SourceLocationReflection *const reflection);
2380
2381 /**
2382 * Issues an error which is not identified in the XPath specifications. This function
2383 * is among other things used for implementing the <tt>fn:error()</tt> function.
2384 */
2385 void error(const QString &message,
2386 const QXmlName qName,
2387 const SourceLocationReflection *const r);
2388
2389 /**
2390 * @return the QAbstractMessageHandler which functions such as warning() and
2391 * error() should submit messages to. This function
2392 * may never return @c null; a valid QAbstractMessageHandler pointer must always be returned.
2393 */
2394 virtual QAbstractMessageHandler *messageHandler() const = 0;
2395
2396 virtual NamePool::Ptr namePool() const = 0;
2397
2398 /**
2399 * Returns a string representation of the error code @p code.
2400 *
2401 * @see ReportContext::ErrorCode
2402 * @param errorCode identifies the error condition, as described
2403 * in <a href="http://www.w3.org/TR/xpath20/#id-errors">XML Path
2404 * Language (XPath) 2.0, G Error Conditions</a>
2405 */
2406 static QString codeToString(const ReportContext::ErrorCode errorCode);
2407
2408 /**
2409 * @returns the error code part of @p typeURI and sets @p uri to the error namespace. Note
2410 * that the error namespace not necessarily is the namespace for XPath and
2411 * XQuery errors, http://www.w3.org/2005/xqt-errors, but can be user defined.
2412 */
2413 static QString codeFromURI(const QString &typeURI,
2414 QString &uri);
2415
2416 /**
2417 * @short Returns the source location applying for @p reflection.
2418 */
2419 virtual QSourceLocation locationFor(const SourceLocationReflection *const reflection) const = 0;
2420
2421 /**
2422 * Resolves @p relative against @p baseURI, possibly using a URI resolver.
2423 */
2424 QUrl resolveURI(const QUrl &relative,
2425 const QUrl &baseURI) const;
2426
2427 /**
2428 * @short The URI resolver in use.
2429 *
2430 * If no URI resolver is in use, a @c null pointer is returned.
2431 *
2432 * @note You should probably use resolveURI(), which handles the case of
2433 * when uriResolver() is @c null.
2434 */
2435 virtual const QAbstractUriResolver *uriResolver() const = 0;
2436
2437 private:
2438 void createError(const QString &description,
2439 const QtMsgType type,
2440 const QUrl &id,
2441 const QSourceLocation &sourceLocation) const;
2442 static inline QString finalizeDescription(const QString &desc);
2443 QSourceLocation lookupSourceLocation(const SourceLocationReflection *const ref) const;
2444
2445 Q_DISABLE_COPY(ReportContext)
2446 };
2447
2448 /**
2449 * @short This is the class type that is being thrown when a query error occur.
2450 *
2451 * @relates ReportContext
2452 */
2453 typedef bool Exception;
2454}
2455
2456QT_END_NAMESPACE
2457
2458#endif
2459

source code of qtxmlpatterns/src/xmlpatterns/environment/qreportcontext_p.h