lxml 6.0.0__cp310-cp310-win_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. lxml/ElementInclude.py +244 -0
  2. lxml/__init__.py +22 -0
  3. lxml/_elementpath.cp310-win_arm64.pyd +0 -0
  4. lxml/_elementpath.py +343 -0
  5. lxml/apihelpers.pxi +1801 -0
  6. lxml/builder.cp310-win_arm64.pyd +0 -0
  7. lxml/builder.py +243 -0
  8. lxml/classlookup.pxi +580 -0
  9. lxml/cleanup.pxi +215 -0
  10. lxml/cssselect.py +101 -0
  11. lxml/debug.pxi +36 -0
  12. lxml/docloader.pxi +178 -0
  13. lxml/doctestcompare.py +488 -0
  14. lxml/dtd.pxi +479 -0
  15. lxml/etree.cp310-win_arm64.pyd +0 -0
  16. lxml/etree.h +244 -0
  17. lxml/etree.pyx +3853 -0
  18. lxml/etree_api.h +204 -0
  19. lxml/extensions.pxi +830 -0
  20. lxml/html/ElementSoup.py +10 -0
  21. lxml/html/__init__.py +1927 -0
  22. lxml/html/_diffcommand.py +86 -0
  23. lxml/html/_difflib.cp310-win_arm64.pyd +0 -0
  24. lxml/html/_difflib.py +2106 -0
  25. lxml/html/_html5builder.py +100 -0
  26. lxml/html/_setmixin.py +56 -0
  27. lxml/html/builder.py +173 -0
  28. lxml/html/clean.py +21 -0
  29. lxml/html/defs.py +135 -0
  30. lxml/html/diff.cp310-win_arm64.pyd +0 -0
  31. lxml/html/diff.py +972 -0
  32. lxml/html/formfill.py +299 -0
  33. lxml/html/html5parser.py +260 -0
  34. lxml/html/soupparser.py +314 -0
  35. lxml/html/usedoctest.py +13 -0
  36. lxml/includes/__init__.pxd +0 -0
  37. lxml/includes/__init__.py +0 -0
  38. lxml/includes/c14n.pxd +25 -0
  39. lxml/includes/config.pxd +3 -0
  40. lxml/includes/dtdvalid.pxd +18 -0
  41. lxml/includes/etree_defs.h +379 -0
  42. lxml/includes/etreepublic.pxd +237 -0
  43. lxml/includes/extlibs/__init__.py +0 -0
  44. lxml/includes/extlibs/zconf.h +543 -0
  45. lxml/includes/extlibs/zlib.h +1938 -0
  46. lxml/includes/htmlparser.pxd +56 -0
  47. lxml/includes/libexslt/__init__.py +0 -0
  48. lxml/includes/libexslt/exslt.h +108 -0
  49. lxml/includes/libexslt/exsltconfig.h +70 -0
  50. lxml/includes/libexslt/exsltexports.h +63 -0
  51. lxml/includes/libexslt/libexslt.h +29 -0
  52. lxml/includes/libxml/HTMLparser.h +320 -0
  53. lxml/includes/libxml/HTMLtree.h +147 -0
  54. lxml/includes/libxml/SAX.h +204 -0
  55. lxml/includes/libxml/SAX2.h +173 -0
  56. lxml/includes/libxml/__init__.py +0 -0
  57. lxml/includes/libxml/c14n.h +128 -0
  58. lxml/includes/libxml/catalog.h +182 -0
  59. lxml/includes/libxml/chvalid.h +230 -0
  60. lxml/includes/libxml/debugXML.h +217 -0
  61. lxml/includes/libxml/dict.h +81 -0
  62. lxml/includes/libxml/encoding.h +233 -0
  63. lxml/includes/libxml/entities.h +151 -0
  64. lxml/includes/libxml/globals.h +529 -0
  65. lxml/includes/libxml/hash.h +236 -0
  66. lxml/includes/libxml/list.h +137 -0
  67. lxml/includes/libxml/nanoftp.h +186 -0
  68. lxml/includes/libxml/nanohttp.h +81 -0
  69. lxml/includes/libxml/parser.h +1265 -0
  70. lxml/includes/libxml/parserInternals.h +662 -0
  71. lxml/includes/libxml/pattern.h +100 -0
  72. lxml/includes/libxml/relaxng.h +218 -0
  73. lxml/includes/libxml/schemasInternals.h +958 -0
  74. lxml/includes/libxml/schematron.h +142 -0
  75. lxml/includes/libxml/threads.h +94 -0
  76. lxml/includes/libxml/tree.h +1314 -0
  77. lxml/includes/libxml/uri.h +94 -0
  78. lxml/includes/libxml/valid.h +448 -0
  79. lxml/includes/libxml/xinclude.h +129 -0
  80. lxml/includes/libxml/xlink.h +189 -0
  81. lxml/includes/libxml/xmlIO.h +369 -0
  82. lxml/includes/libxml/xmlautomata.h +146 -0
  83. lxml/includes/libxml/xmlerror.h +919 -0
  84. lxml/includes/libxml/xmlexports.h +50 -0
  85. lxml/includes/libxml/xmlmemory.h +228 -0
  86. lxml/includes/libxml/xmlmodule.h +57 -0
  87. lxml/includes/libxml/xmlreader.h +428 -0
  88. lxml/includes/libxml/xmlregexp.h +222 -0
  89. lxml/includes/libxml/xmlsave.h +88 -0
  90. lxml/includes/libxml/xmlschemas.h +246 -0
  91. lxml/includes/libxml/xmlschemastypes.h +152 -0
  92. lxml/includes/libxml/xmlstring.h +140 -0
  93. lxml/includes/libxml/xmlunicode.h +202 -0
  94. lxml/includes/libxml/xmlversion.h +526 -0
  95. lxml/includes/libxml/xmlwriter.h +488 -0
  96. lxml/includes/libxml/xpath.h +575 -0
  97. lxml/includes/libxml/xpathInternals.h +632 -0
  98. lxml/includes/libxml/xpointer.h +137 -0
  99. lxml/includes/libxslt/__init__.py +0 -0
  100. lxml/includes/libxslt/attributes.h +39 -0
  101. lxml/includes/libxslt/documents.h +93 -0
  102. lxml/includes/libxslt/extensions.h +262 -0
  103. lxml/includes/libxslt/extra.h +72 -0
  104. lxml/includes/libxslt/functions.h +78 -0
  105. lxml/includes/libxslt/imports.h +75 -0
  106. lxml/includes/libxslt/keys.h +53 -0
  107. lxml/includes/libxslt/libxslt.h +36 -0
  108. lxml/includes/libxslt/namespaces.h +68 -0
  109. lxml/includes/libxslt/numbersInternals.h +73 -0
  110. lxml/includes/libxslt/preproc.h +43 -0
  111. lxml/includes/libxslt/security.h +104 -0
  112. lxml/includes/libxslt/templates.h +77 -0
  113. lxml/includes/libxslt/transform.h +207 -0
  114. lxml/includes/libxslt/trio.h +216 -0
  115. lxml/includes/libxslt/triodef.h +220 -0
  116. lxml/includes/libxslt/variables.h +118 -0
  117. lxml/includes/libxslt/win32config.h +51 -0
  118. lxml/includes/libxslt/xslt.h +110 -0
  119. lxml/includes/libxslt/xsltInternals.h +1992 -0
  120. lxml/includes/libxslt/xsltconfig.h +179 -0
  121. lxml/includes/libxslt/xsltexports.h +64 -0
  122. lxml/includes/libxslt/xsltlocale.h +44 -0
  123. lxml/includes/libxslt/xsltutils.h +343 -0
  124. lxml/includes/lxml-version.h +3 -0
  125. lxml/includes/relaxng.pxd +64 -0
  126. lxml/includes/schematron.pxd +34 -0
  127. lxml/includes/tree.pxd +492 -0
  128. lxml/includes/uri.pxd +5 -0
  129. lxml/includes/xinclude.pxd +22 -0
  130. lxml/includes/xmlerror.pxd +852 -0
  131. lxml/includes/xmlparser.pxd +303 -0
  132. lxml/includes/xmlschema.pxd +35 -0
  133. lxml/includes/xpath.pxd +136 -0
  134. lxml/includes/xslt.pxd +190 -0
  135. lxml/isoschematron/__init__.py +348 -0
  136. lxml/isoschematron/resources/rng/iso-schematron.rng +709 -0
  137. lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl +75 -0
  138. lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl +77 -0
  139. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl +313 -0
  140. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl +1160 -0
  141. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
  142. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1796 -0
  143. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +588 -0
  144. lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +84 -0
  145. lxml/iterparse.pxi +438 -0
  146. lxml/lxml.etree.h +244 -0
  147. lxml/lxml.etree_api.h +204 -0
  148. lxml/nsclasses.pxi +281 -0
  149. lxml/objectify.cp310-win_arm64.pyd +0 -0
  150. lxml/objectify.pyx +2149 -0
  151. lxml/objectpath.pxi +332 -0
  152. lxml/parser.pxi +2059 -0
  153. lxml/parsertarget.pxi +180 -0
  154. lxml/proxy.pxi +619 -0
  155. lxml/public-api.pxi +178 -0
  156. lxml/pyclasslookup.py +3 -0
  157. lxml/readonlytree.pxi +565 -0
  158. lxml/relaxng.pxi +165 -0
  159. lxml/sax.cp310-win_arm64.pyd +0 -0
  160. lxml/sax.py +286 -0
  161. lxml/saxparser.pxi +875 -0
  162. lxml/schematron.pxi +173 -0
  163. lxml/serializer.pxi +1849 -0
  164. lxml/usedoctest.py +13 -0
  165. lxml/xinclude.pxi +67 -0
  166. lxml/xmlerror.pxi +1654 -0
  167. lxml/xmlid.pxi +179 -0
  168. lxml/xmlschema.pxi +215 -0
  169. lxml/xpath.pxi +487 -0
  170. lxml/xslt.pxi +957 -0
  171. lxml/xsltext.pxi +242 -0
  172. lxml-6.0.0.dist-info/METADATA +163 -0
  173. lxml-6.0.0.dist-info/RECORD +177 -0
  174. lxml-6.0.0.dist-info/WHEEL +5 -0
  175. lxml-6.0.0.dist-info/licenses/LICENSE.txt +31 -0
  176. lxml-6.0.0.dist-info/licenses/LICENSES.txt +29 -0
  177. lxml-6.0.0.dist-info/top_level.txt +1 -0
lxml/xmlerror.pxi ADDED
@@ -0,0 +1,1654 @@
1
+ # DEBUG and error logging
2
+
3
+ from lxml.includes cimport xmlerror
4
+ from lxml cimport cvarargs
5
+
6
+ DEF GLOBAL_ERROR_LOG = "_GlobalErrorLog"
7
+ DEF XSLT_ERROR_LOG = "_XSLTErrorLog"
8
+
9
+ # module level API functions
10
+
11
+ def clear_error_log():
12
+ """clear_error_log()
13
+
14
+ Clear the global error log. Note that this log is already bound to a
15
+ fixed size.
16
+
17
+ Note: since lxml 2.2, the global error log is local to a thread
18
+ and this function will only clear the global error log of the
19
+ current thread.
20
+ """
21
+ _getThreadErrorLog(GLOBAL_ERROR_LOG).clear()
22
+
23
+
24
+ # setup for global log:
25
+
26
+ cdef void _initThreadLogging() noexcept:
27
+ # Disable generic error lines from libxml2.
28
+ _connectGenericErrorLog(None)
29
+
30
+ # Divert XSLT error messages to the global XSLT error log instead of stderr.
31
+ xslt.xsltSetGenericErrorFunc(NULL, <xmlerror.xmlGenericErrorFunc>_receiveXSLTError)
32
+
33
+
34
+ # Logging classes
35
+
36
+ @cython.final
37
+ @cython.freelist(16)
38
+ cdef class _LogEntry:
39
+ """A log message entry from an error log.
40
+
41
+ Attributes:
42
+
43
+ - message: the message text
44
+ - domain: the domain ID (see lxml.etree.ErrorDomains)
45
+ - type: the message type ID (see lxml.etree.ErrorTypes)
46
+ - level: the log level ID (see lxml.etree.ErrorLevels)
47
+ - line: the line at which the message originated (if applicable)
48
+ - column: the character column at which the message originated (if applicable)
49
+ - filename: the name of the file in which the message originated (if applicable)
50
+ - path: the location in which the error was found (if available)
51
+ """
52
+ cdef readonly int domain
53
+ cdef readonly int type
54
+ cdef readonly int level
55
+ cdef readonly long line
56
+ cdef readonly int column
57
+ cdef basestring _message
58
+ cdef basestring _filename
59
+ cdef char* _c_message
60
+ cdef xmlChar* _c_filename
61
+ cdef xmlChar* _c_path
62
+
63
+ def __dealloc__(self):
64
+ tree.xmlFree(self._c_message)
65
+ tree.xmlFree(self._c_filename)
66
+ tree.xmlFree(self._c_path)
67
+
68
+ @cython.final
69
+ cdef int _setError(self, const xmlerror.xmlError* error) except -1:
70
+ self.domain = error.domain
71
+ self.type = error.code
72
+ self.level = <int>error.level
73
+ self.line = <long>error.line
74
+ self.column = error.int2
75
+ self._c_message = NULL
76
+ self._c_filename = NULL
77
+ self._c_path = NULL
78
+ if (error.message is NULL or
79
+ error.message[0] == b'\0' or
80
+ error.message[0] == b'\n' and error.message[1] == b'\0'):
81
+ self._message = "unknown error"
82
+ else:
83
+ self._message = None
84
+ self._c_message = <char*> tree.xmlStrdup(
85
+ <const_xmlChar*> error.message)
86
+ if not self._c_message:
87
+ raise MemoryError()
88
+ if error.file is NULL:
89
+ self._filename = '<string>'
90
+ else:
91
+ self._filename = None
92
+ self._c_filename = tree.xmlStrdup(<const_xmlChar*> error.file)
93
+ if not self._c_filename:
94
+ raise MemoryError()
95
+ if error.node is not NULL:
96
+ self._c_path = tree.xmlGetNodePath(<xmlNode*> error.node)
97
+ c_line = tree.xmlGetLineNo(<xmlNode*> error.node)
98
+ if c_line > limits.INT_MAX:
99
+ self.line = c_line
100
+
101
+ @cython.final
102
+ cdef _setGeneric(self, int domain, int type, int level, long line,
103
+ message, filename):
104
+ self.domain = domain
105
+ self.type = type
106
+ self.level = level
107
+ self.line = line
108
+ self.column = 0
109
+ self._message = message
110
+ self._filename = filename
111
+ self._c_path = NULL
112
+
113
+ def __repr__(self):
114
+ return "%s:%d:%d:%s:%s:%s: %s" % (
115
+ self.filename, self.line, self.column, self.level_name,
116
+ self.domain_name, self.type_name, self.message)
117
+
118
+ @property
119
+ def domain_name(self):
120
+ """The name of the error domain. See lxml.etree.ErrorDomains
121
+ """
122
+ return ErrorDomains._getName(self.domain, "unknown")
123
+
124
+ @property
125
+ def type_name(self):
126
+ """The name of the error type. See lxml.etree.ErrorTypes
127
+ """
128
+ if self.domain == ErrorDomains.RELAXNGV:
129
+ getName = RelaxNGErrorTypes._getName
130
+ else:
131
+ getName = ErrorTypes._getName
132
+ return getName(self.type, "unknown")
133
+
134
+ @property
135
+ def level_name(self):
136
+ """The name of the error level. See lxml.etree.ErrorLevels
137
+ """
138
+ return ErrorLevels._getName(self.level, "unknown")
139
+
140
+ @property
141
+ def message(self):
142
+ """The log message string.
143
+ """
144
+ cdef size_t size
145
+ if self._message is not None:
146
+ return self._message
147
+ if self._c_message is NULL:
148
+ return None
149
+ size = cstring_h.strlen(self._c_message)
150
+ if size > 0 and self._c_message[size-1] == b'\n':
151
+ size -= 1 # strip EOL
152
+ # cannot use funicode() here because the message may contain
153
+ # byte encoded file paths etc.
154
+ try:
155
+ self._message = self._c_message[:size].decode('utf8')
156
+ except UnicodeDecodeError:
157
+ try:
158
+ self._message = self._c_message[:size].decode(
159
+ 'ascii', 'backslashreplace')
160
+ except UnicodeDecodeError:
161
+ self._message = '<undecodable error message>'
162
+ if self._c_message:
163
+ # clean up early
164
+ tree.xmlFree(self._c_message)
165
+ self._c_message = NULL
166
+ return self._message
167
+
168
+ @property
169
+ def filename(self):
170
+ """The file path where the report originated, if any.
171
+ """
172
+ if self._filename is None:
173
+ if self._c_filename is not NULL:
174
+ self._filename = _decodeFilename(self._c_filename)
175
+ # clean up early
176
+ tree.xmlFree(self._c_filename)
177
+ self._c_filename = NULL
178
+ return self._filename
179
+
180
+ @property
181
+ def path(self):
182
+ """The XPath for the node where the error was detected.
183
+ """
184
+ return funicode(self._c_path) if self._c_path is not NULL else None
185
+
186
+
187
+ cdef class _BaseErrorLog:
188
+ cdef _LogEntry _first_error
189
+ cdef readonly object last_error
190
+ def __init__(self, first_error, last_error):
191
+ self._first_error = first_error
192
+ self.last_error = last_error
193
+
194
+ cpdef copy(self):
195
+ return _BaseErrorLog(self._first_error, self.last_error)
196
+
197
+ def __repr__(self):
198
+ return ''
199
+
200
+ cpdef receive(self, _LogEntry entry):
201
+ pass
202
+
203
+ @cython.final
204
+ cdef int _receive(self, const xmlerror.xmlError* error) except -1:
205
+ cdef bint is_error
206
+ cdef _LogEntry entry
207
+ cdef _BaseErrorLog global_log
208
+ entry = _LogEntry.__new__(_LogEntry)
209
+ entry._setError(error)
210
+ is_error = error.level == xmlerror.XML_ERR_ERROR or \
211
+ error.level == xmlerror.XML_ERR_FATAL
212
+ global_log = _getThreadErrorLog(GLOBAL_ERROR_LOG)
213
+ if global_log is not self:
214
+ global_log.receive(entry)
215
+ if is_error:
216
+ global_log.last_error = entry
217
+ self.receive(entry)
218
+ if is_error:
219
+ self.last_error = entry
220
+
221
+ @cython.final
222
+ cdef int _receiveGeneric(self, int domain, int type, int level, long line,
223
+ message, filename) except -1:
224
+ cdef bint is_error
225
+ cdef _LogEntry entry
226
+ cdef _BaseErrorLog global_log
227
+ entry = _LogEntry.__new__(_LogEntry)
228
+ entry._setGeneric(domain, type, level, line, message, filename)
229
+ is_error = level == xmlerror.XML_ERR_ERROR or \
230
+ level == xmlerror.XML_ERR_FATAL
231
+ global_log = _getThreadErrorLog(GLOBAL_ERROR_LOG)
232
+ if global_log is not self:
233
+ global_log.receive(entry)
234
+ if is_error:
235
+ global_log.last_error = entry
236
+ self.receive(entry)
237
+ if is_error:
238
+ self.last_error = entry
239
+
240
+ @cython.final
241
+ cdef _buildParseException(self, exctype, default_message):
242
+ code = xmlerror.XML_ERR_INTERNAL_ERROR
243
+ if self._first_error is None:
244
+ return exctype(default_message, code, 0, 0)
245
+ message = self._first_error.message
246
+ if message:
247
+ code = self._first_error.type
248
+ else:
249
+ message = default_message
250
+ line = self._first_error.line
251
+ column = self._first_error.column
252
+ filename = self._first_error.filename
253
+ if line > 0:
254
+ if column > 0:
255
+ message = f"{message}, line {line}, column {column}"
256
+ else:
257
+ message = f"{message}, line {line}"
258
+ return exctype(message, code, line, column, filename)
259
+
260
+ @cython.final
261
+ cdef _buildExceptionMessage(self, default_message):
262
+ if self._first_error is None:
263
+ return default_message
264
+ if self._first_error.message:
265
+ message = self._first_error.message
266
+ elif default_message is None:
267
+ return None
268
+ else:
269
+ message = default_message
270
+ if self._first_error.line > 0:
271
+ if self._first_error.column > 0:
272
+ message = f"{message}, line {self._first_error.line}, column {self._first_error.column}"
273
+ else:
274
+ message = f"{message}, line {self._first_error.line}"
275
+ return message
276
+
277
+ cdef class _ListErrorLog(_BaseErrorLog):
278
+ "Immutable base version of a list based error log."
279
+ cdef list _entries
280
+ cdef int _offset
281
+ def __init__(self, entries, first_error, last_error):
282
+ if entries:
283
+ if first_error is None:
284
+ first_error = entries[0]
285
+ if last_error is None:
286
+ last_error = entries[-1]
287
+ _BaseErrorLog.__init__(self, first_error, last_error)
288
+ self._entries = entries
289
+
290
+ cpdef copy(self):
291
+ """Creates a shallow copy of this error log. Reuses the list of
292
+ entries.
293
+ """
294
+ cdef _ListErrorLog log = _ListErrorLog(
295
+ self._entries, self._first_error, self.last_error)
296
+ log._offset = self._offset
297
+ return log
298
+
299
+ def __iter__(self):
300
+ entries = self._entries
301
+ if self._offset:
302
+ entries = islice(entries, self._offset)
303
+ return iter(entries)
304
+
305
+ def __repr__(self):
306
+ return '\n'.join([repr(entry) for entry in self])
307
+
308
+ def __getitem__(self, index):
309
+ if self._offset:
310
+ index += self._offset
311
+ return self._entries[index]
312
+
313
+ def __len__(self):
314
+ return len(self._entries) - self._offset
315
+
316
+ def __contains__(self, error_type):
317
+ cdef Py_ssize_t i
318
+ for i, entry in enumerate(self._entries):
319
+ if i < self._offset:
320
+ continue
321
+ if entry.type == error_type:
322
+ return True
323
+ return False
324
+
325
+ def __bool__(self):
326
+ return len(self._entries) > self._offset
327
+
328
+ def filter_domains(self, domains):
329
+ """Filter the errors by the given domains and return a new error log
330
+ containing the matches.
331
+ """
332
+ cdef _LogEntry entry
333
+ if isinstance(domains, int):
334
+ domains = (domains,)
335
+ filtered = [entry for entry in self if entry.domain in domains]
336
+ return _ListErrorLog(filtered, None, None)
337
+
338
+ def filter_types(self, types):
339
+ """filter_types(self, types)
340
+
341
+ Filter the errors by the given types and return a new error
342
+ log containing the matches.
343
+ """
344
+ cdef _LogEntry entry
345
+ if isinstance(types, int):
346
+ types = (types,)
347
+ filtered = [entry for entry in self if entry.type in types]
348
+ return _ListErrorLog(filtered, None, None)
349
+
350
+ def filter_levels(self, levels):
351
+ """filter_levels(self, levels)
352
+
353
+ Filter the errors by the given error levels and return a new
354
+ error log containing the matches.
355
+ """
356
+ cdef _LogEntry entry
357
+ if isinstance(levels, int):
358
+ levels = (levels,)
359
+ filtered = [entry for entry in self if entry.level in levels]
360
+ return _ListErrorLog(filtered, None, None)
361
+
362
+ def filter_from_level(self, level):
363
+ """filter_from_level(self, level)
364
+
365
+ Return a log with all messages of the requested level of worse.
366
+ """
367
+ cdef _LogEntry entry
368
+ filtered = [entry for entry in self if entry.level >= level]
369
+ return _ListErrorLog(filtered, None, None)
370
+
371
+ def filter_from_fatals(self):
372
+ """filter_from_fatals(self)
373
+
374
+ Convenience method to get all fatal error messages.
375
+ """
376
+ return self.filter_from_level(ErrorLevels.FATAL)
377
+
378
+ def filter_from_errors(self):
379
+ """filter_from_errors(self)
380
+
381
+ Convenience method to get all error messages or worse.
382
+ """
383
+ return self.filter_from_level(ErrorLevels.ERROR)
384
+
385
+ def filter_from_warnings(self):
386
+ """filter_from_warnings(self)
387
+
388
+ Convenience method to get all warnings or worse.
389
+ """
390
+ return self.filter_from_level(ErrorLevels.WARNING)
391
+
392
+
393
+ @cython.final
394
+ @cython.internal
395
+ cdef class _ErrorLogContext:
396
+ """
397
+ Error log context for the 'with' statement.
398
+ Stores a reference to the current callbacks to allow for
399
+ recursively stacked log contexts.
400
+ """
401
+ cdef xmlerror.xmlStructuredErrorFunc old_error_func
402
+ cdef void* old_error_context
403
+ cdef xmlerror.xmlGenericErrorFunc old_xslt_error_func
404
+ cdef void* old_xslt_error_context
405
+ cdef _BaseErrorLog old_xslt_error_log
406
+
407
+ cdef int push_error_log(self, _BaseErrorLog log) except -1:
408
+ self.old_error_func = xmlerror.xmlStructuredError
409
+ self.old_error_context = xmlerror.xmlStructuredErrorContext
410
+ xmlerror.xmlSetStructuredErrorFunc(
411
+ <void*>log, <xmlerror.xmlStructuredErrorFunc>_receiveError)
412
+
413
+ # xslt.xsltSetGenericErrorFunc() is not thread-local => keep error log in TLS
414
+ self.old_xslt_error_func = xslt.xsltGenericError
415
+ self.old_xslt_error_context = xslt.xsltGenericErrorContext
416
+ self.old_xslt_error_log = _getThreadErrorLog(XSLT_ERROR_LOG)
417
+ _setThreadErrorLog(XSLT_ERROR_LOG, log)
418
+ xslt.xsltSetGenericErrorFunc(
419
+ NULL, <xmlerror.xmlGenericErrorFunc>_receiveXSLTError)
420
+ return 0
421
+
422
+ cdef int pop_error_log(self) except -1:
423
+ xmlerror.xmlSetStructuredErrorFunc(
424
+ self.old_error_context, self.old_error_func)
425
+ xslt.xsltSetGenericErrorFunc(
426
+ self.old_xslt_error_context, self.old_xslt_error_func)
427
+ _setThreadErrorLog(XSLT_ERROR_LOG, self.old_xslt_error_log)
428
+ self.old_xslt_error_log= None
429
+ return 0
430
+
431
+
432
+ cdef class _ErrorLog(_ListErrorLog):
433
+ cdef list _logContexts
434
+ def __cinit__(self):
435
+ self._logContexts = []
436
+
437
+ def __init__(self):
438
+ _ListErrorLog.__init__(self, [], None, None)
439
+
440
+ @cython.final
441
+ cdef int __enter__(self) except -1:
442
+ return self.connect()
443
+
444
+ def __exit__(self, *args):
445
+ # TODO: make this a cdef function when Cython supports it
446
+ self.disconnect()
447
+
448
+ @cython.final
449
+ cdef int connect(self) except -1:
450
+ self._first_error = None
451
+ del self._entries[:]
452
+
453
+ cdef _ErrorLogContext context = _ErrorLogContext.__new__(_ErrorLogContext)
454
+ context.push_error_log(self)
455
+ self._logContexts.append(context)
456
+ return 0
457
+
458
+ @cython.final
459
+ cdef int disconnect(self) except -1:
460
+ cdef _ErrorLogContext context = self._logContexts.pop()
461
+ context.pop_error_log()
462
+ return 0
463
+
464
+ cpdef clear(self):
465
+ self._first_error = None
466
+ self.last_error = None
467
+ self._offset = 0
468
+ del self._entries[:]
469
+
470
+ cpdef copy(self):
471
+ """Creates a shallow copy of this error log and the list of entries.
472
+ """
473
+ return _ListErrorLog(
474
+ self._entries[self._offset:],
475
+ self._first_error, self.last_error)
476
+
477
+ def __iter__(self):
478
+ return iter(self._entries[self._offset:])
479
+
480
+ cpdef receive(self, _LogEntry entry):
481
+ if self._first_error is None and entry.level >= xmlerror.XML_ERR_ERROR:
482
+ self._first_error = entry
483
+ self._entries.append(entry)
484
+
485
+ cdef class _DomainErrorLog(_ErrorLog):
486
+ def __init__(self, domains):
487
+ _ErrorLog.__init__(self)
488
+ self._accepted_domains = tuple(domains)
489
+
490
+ cpdef receive(self, _LogEntry entry):
491
+ if entry.domain in self._accepted_domains:
492
+ _ErrorLog.receive(self, entry)
493
+
494
+ cdef class _RotatingErrorLog(_ErrorLog):
495
+ cdef int _max_len
496
+ def __init__(self, max_len):
497
+ _ErrorLog.__init__(self)
498
+ self._max_len = max_len
499
+
500
+ cpdef receive(self, _LogEntry entry):
501
+ if self._first_error is None and entry.level >= xmlerror.XML_ERR_ERROR:
502
+ self._first_error = entry
503
+ self._entries.append(entry)
504
+
505
+ if len(self._entries) > self._max_len:
506
+ self._offset += 1
507
+ if self._offset > self._max_len // 3:
508
+ offset = self._offset
509
+ self._offset = 0
510
+ del self._entries[:offset]
511
+
512
+ cdef class PyErrorLog(_BaseErrorLog):
513
+ """PyErrorLog(self, logger_name=None, logger=None)
514
+ A global error log that connects to the Python stdlib logging package.
515
+
516
+ The constructor accepts an optional logger name or a readily
517
+ instantiated logger instance.
518
+
519
+ If you want to change the mapping between libxml2's ErrorLevels and Python
520
+ logging levels, you can modify the level_map dictionary from a subclass.
521
+
522
+ The default mapping is::
523
+
524
+ ErrorLevels.WARNING = logging.WARNING
525
+ ErrorLevels.ERROR = logging.ERROR
526
+ ErrorLevels.FATAL = logging.CRITICAL
527
+
528
+ You can also override the method ``receive()`` that takes a LogEntry
529
+ object and calls ``self.log(log_entry, format_string, arg1, arg2, ...)``
530
+ with appropriate data.
531
+ """
532
+ cdef readonly dict level_map
533
+ cdef object _map_level
534
+ cdef object _log
535
+ def __init__(self, logger_name=None, logger=None):
536
+ _BaseErrorLog.__init__(self, None, None)
537
+ import logging
538
+ self.level_map = {
539
+ ErrorLevels.WARNING : logging.WARNING,
540
+ ErrorLevels.ERROR : logging.ERROR,
541
+ ErrorLevels.FATAL : logging.CRITICAL
542
+ }
543
+ self._map_level = self.level_map.get
544
+ if logger is None:
545
+ if logger_name:
546
+ logger = logging.getLogger(logger_name)
547
+ else:
548
+ logger = logging.getLogger()
549
+ self._log = logger.log
550
+
551
+ cpdef copy(self):
552
+ """Dummy method that returns an empty error log.
553
+ """
554
+ return _ListErrorLog([], None, None)
555
+
556
+ def log(self, log_entry, message, *args):
557
+ """log(self, log_entry, message, *args)
558
+
559
+ Called by the .receive() method to log a _LogEntry instance to
560
+ the Python logging system. This handles the error level
561
+ mapping.
562
+
563
+ In the default implementation, the ``message`` argument
564
+ receives a complete log line, and there are no further
565
+ ``args``. To change the message format, it is best to
566
+ override the .receive() method instead of this one.
567
+ """
568
+ self._log(
569
+ self._map_level(log_entry.level, 0),
570
+ message, *args
571
+ )
572
+
573
+ cpdef receive(self, _LogEntry log_entry):
574
+ """receive(self, log_entry)
575
+
576
+ Receive a _LogEntry instance from the logging system. Calls
577
+ the .log() method with appropriate parameters::
578
+
579
+ self.log(log_entry, repr(log_entry))
580
+
581
+ You can override this method to provide your own log output
582
+ format.
583
+ """
584
+ self.log(log_entry, repr(log_entry))
585
+
586
+ # thread-local, global list log to collect error output messages from
587
+ # libxml2/libxslt
588
+
589
+ cdef _BaseErrorLog __GLOBAL_ERROR_LOG = _RotatingErrorLog(__MAX_LOG_SIZE)
590
+
591
+
592
+ cdef _BaseErrorLog _getThreadErrorLog(name):
593
+ """Retrieve the current error log with name 'name' of this thread."""
594
+ cdef python.PyObject* thread_dict
595
+ thread_dict = python.PyThreadState_GetDict()
596
+ if thread_dict is NULL:
597
+ return __GLOBAL_ERROR_LOG
598
+ try:
599
+ return (<object>thread_dict)[name]
600
+ except KeyError:
601
+ log = (<object>thread_dict)[name] = \
602
+ _RotatingErrorLog(__MAX_LOG_SIZE)
603
+ return log
604
+
605
+
606
+ cdef _setThreadErrorLog(name, _BaseErrorLog log):
607
+ """Set the global error log of this thread."""
608
+ cdef python.PyObject* thread_dict
609
+ thread_dict = python.PyThreadState_GetDict()
610
+ if thread_dict is NULL:
611
+ if name == GLOBAL_ERROR_LOG:
612
+ global __GLOBAL_ERROR_LOG
613
+ __GLOBAL_ERROR_LOG = log
614
+ else:
615
+ (<object>thread_dict)[name] = log
616
+
617
+
618
+ cdef __copyGlobalErrorLog():
619
+ "Helper function for properties in exceptions."
620
+ return _getThreadErrorLog(GLOBAL_ERROR_LOG).copy()
621
+
622
+
623
+ def use_global_python_log(PyErrorLog log not None):
624
+ """use_global_python_log(log)
625
+
626
+ Replace the global error log by an etree.PyErrorLog that uses the
627
+ standard Python logging package.
628
+
629
+ Note that this disables access to the global error log from exceptions.
630
+ Parsers, XSLT etc. will continue to provide their normal local error log.
631
+
632
+ Note: prior to lxml 2.2, this changed the error log globally.
633
+ Since lxml 2.2, the global error log is local to a thread and this
634
+ function will only set the global error log of the current thread.
635
+ """
636
+ _setThreadErrorLog(GLOBAL_ERROR_LOG, log)
637
+
638
+
639
+ # local log functions: forward error to logger object
640
+ cdef void _forwardError(void* c_log_handler, const xmlerror.xmlError* error) noexcept with gil:
641
+ cdef _BaseErrorLog log_handler
642
+ if c_log_handler is not NULL:
643
+ log_handler = <_BaseErrorLog>c_log_handler
644
+ elif error.domain == xmlerror.XML_FROM_XSLT:
645
+ log_handler = _getThreadErrorLog(XSLT_ERROR_LOG)
646
+ else:
647
+ log_handler = _getThreadErrorLog(GLOBAL_ERROR_LOG)
648
+ log_handler._receive(error)
649
+
650
+
651
+ cdef void _receiveError(void* c_log_handler, const xmlerror.xmlError* error) noexcept nogil:
652
+ # no Python objects here, may be called without thread context !
653
+ if __DEBUG:
654
+ _forwardError(c_log_handler, error)
655
+
656
+
657
+ cdef void _receiveXSLTError(void* c_log_handler, char* msg, ...) noexcept nogil:
658
+ # no Python objects here, may be called without thread context !
659
+ cdef cvarargs.va_list args
660
+ cvarargs.va_start(args, msg)
661
+ _receiveGenericError(c_log_handler, xmlerror.XML_FROM_XSLT, msg, args)
662
+ cvarargs.va_end(args)
663
+
664
+ cdef void _receiveRelaxNGParseError(void* c_log_handler, char* msg, ...) noexcept nogil:
665
+ # no Python objects here, may be called without thread context !
666
+ cdef cvarargs.va_list args
667
+ cvarargs.va_start(args, msg)
668
+ _receiveGenericError(c_log_handler, xmlerror.XML_FROM_RELAXNGP, msg, args)
669
+ cvarargs.va_end(args)
670
+
671
+ cdef void _receiveRelaxNGValidationError(void* c_log_handler, char* msg, ...) noexcept nogil:
672
+ # no Python objects here, may be called without thread context !
673
+ cdef cvarargs.va_list args
674
+ cvarargs.va_start(args, msg)
675
+ _receiveGenericError(c_log_handler, xmlerror.XML_FROM_RELAXNGV, msg, args)
676
+ cvarargs.va_end(args)
677
+
678
+ # dummy function: no log output at all
679
+ cdef void _nullGenericErrorFunc(void* ctxt, char* msg, ...) noexcept nogil:
680
+ pass
681
+
682
+
683
+ cdef void _connectGenericErrorLog(log, int c_domain=-1) noexcept:
684
+ cdef xmlerror.xmlGenericErrorFunc error_func = NULL
685
+ c_log = <void*>log
686
+ if c_domain == xmlerror.XML_FROM_XSLT:
687
+ error_func = <xmlerror.xmlGenericErrorFunc>_receiveXSLTError
688
+ elif c_domain == xmlerror.XML_FROM_RELAXNGP:
689
+ error_func = <xmlerror.xmlGenericErrorFunc>_receiveRelaxNGParseError
690
+ elif c_domain == xmlerror.XML_FROM_RELAXNGV:
691
+ error_func = <xmlerror.xmlGenericErrorFunc>_receiveRelaxNGValidationError
692
+
693
+ if log is None or error_func is NULL:
694
+ c_log = NULL
695
+ error_func = <xmlerror.xmlGenericErrorFunc>_nullGenericErrorFunc
696
+ xmlerror.xmlSetGenericErrorFunc(c_log, error_func)
697
+
698
+
699
+ cdef void _receiveGenericError(void* c_log_handler, int c_domain,
700
+ char* msg, cvarargs.va_list args) noexcept nogil:
701
+ # no Python objects here, may be called without thread context !
702
+ cdef xmlerror.xmlError c_error
703
+ cdef char* c_text
704
+ cdef char* c_message
705
+ cdef char* c_element
706
+ cdef char* c_pos
707
+ cdef char* c_name_pos
708
+ cdef char* c_str
709
+ cdef int text_size, element_size, format_count, c_int
710
+ if not __DEBUG or msg is NULL:
711
+ return
712
+ if msg[0] in b'\n\0':
713
+ return
714
+
715
+ c_text = c_element = c_error.file = c_error.node = NULL
716
+ c_error.line = 0
717
+
718
+ # parse "NAME %s" chunks from the format string
719
+ c_name_pos = c_pos = msg
720
+ format_count = 0
721
+ while c_pos[0]:
722
+ if c_pos[0] == b'%':
723
+ c_pos += 1
724
+ if c_pos[0] == b's': # "%s"
725
+ format_count += 1
726
+ c_str = cvarargs.va_charptr(args)
727
+ if c_pos == msg + 1:
728
+ c_text = c_str # msg == "%s..."
729
+ elif c_name_pos[0] == b'e':
730
+ if cstring_h.strncmp(c_name_pos, 'element %s', 10) == 0:
731
+ c_element = c_str
732
+ elif c_name_pos[0] == b'f':
733
+ if cstring_h.strncmp(c_name_pos, 'file %s', 7) == 0:
734
+ if cstring_h.strncmp('string://__STRING__XSLT',
735
+ c_str, 23) == 0:
736
+ c_str = '<xslt>'
737
+ c_error.file = c_str
738
+ elif c_pos[0] == b'd': # "%d"
739
+ format_count += 1
740
+ c_int = cvarargs.va_int(args)
741
+ if cstring_h.strncmp(c_name_pos, 'line %d', 7) == 0:
742
+ c_error.line = c_int
743
+ elif c_pos[0] != b'%': # "%%" == "%"
744
+ format_count += 1
745
+ break # unexpected format or end of string => abort
746
+ elif c_pos[0] == b' ':
747
+ if c_pos[1] != b'%':
748
+ c_name_pos = c_pos + 1
749
+ c_pos += 1
750
+
751
+ c_message = NULL
752
+ if c_text is NULL:
753
+ if c_element is not NULL and format_count == 1:
754
+ # special case: a single occurrence of 'element %s'
755
+ text_size = cstring_h.strlen(msg)
756
+ element_size = cstring_h.strlen(c_element)
757
+ c_message = <char*>stdlib.malloc(
758
+ (text_size + element_size + 1) * sizeof(char))
759
+ stdio.sprintf(c_message, msg, c_element)
760
+ c_error.message = c_message
761
+ else:
762
+ c_error.message = ''
763
+ elif c_element is NULL:
764
+ c_error.message = c_text
765
+ else:
766
+ text_size = cstring_h.strlen(c_text)
767
+ element_size = cstring_h.strlen(c_element)
768
+ c_message = <char*>stdlib.malloc(
769
+ (text_size + 12 + element_size + 1) * sizeof(char))
770
+ if c_message is NULL:
771
+ c_error.message = c_text
772
+ else:
773
+ stdio.sprintf(c_message, "%s, element '%s'", c_text, c_element)
774
+ c_error.message = c_message
775
+
776
+ c_error.domain = c_domain
777
+ c_error.code = xmlerror.XML_ERR_OK # what else?
778
+ c_error.level = xmlerror.XML_ERR_ERROR # what else?
779
+ c_error.int2 = 0
780
+
781
+ _forwardError(c_log_handler, &c_error)
782
+
783
+ if c_message is not NULL:
784
+ stdlib.free(c_message)
785
+
786
+ ################################################################################
787
+ ## CONSTANTS FROM "xmlerror.h" (or rather libxml-xmlerror.html)
788
+ ################################################################################
789
+
790
+ cdef __initErrorConstants():
791
+ "Called at setup time to parse the constants and build the classes below."
792
+ global __ERROR_LEVELS, __ERROR_DOMAINS, __PARSER_ERROR_TYPES, __RELAXNG_ERROR_TYPES
793
+ const_defs = ((ErrorLevels, __ERROR_LEVELS),
794
+ (ErrorDomains, __ERROR_DOMAINS),
795
+ (ErrorTypes, __PARSER_ERROR_TYPES),
796
+ (RelaxNGErrorTypes, __RELAXNG_ERROR_TYPES))
797
+
798
+ for cls, constants in const_defs:
799
+ reverse_dict = {}
800
+ cls._names = reverse_dict
801
+ cls._getName = reverse_dict.get
802
+ for line in constants.splitlines():
803
+ if not line:
804
+ continue
805
+ name, value = line.split('=')
806
+ value = int(value)
807
+ setattr(cls, name, value)
808
+ reverse_dict[value] = name
809
+
810
+ # discard the global string references after use
811
+ __ERROR_LEVELS = __ERROR_DOMAINS = __PARSER_ERROR_TYPES = __RELAXNG_ERROR_TYPES = None
812
+
813
+
814
+ class ErrorLevels(object):
815
+ """Libxml2 error levels"""
816
+
817
+ class ErrorDomains(object):
818
+ """Libxml2 error domains"""
819
+
820
+ class ErrorTypes(object):
821
+ """Libxml2 error types"""
822
+
823
+ class RelaxNGErrorTypes(object):
824
+ """Libxml2 RelaxNG error types"""
825
+
826
+
827
+ # --- BEGIN: GENERATED CONSTANTS ---
828
+
829
+ # This section is generated by the script 'update-error-constants.py'.
830
+
831
+ cdef object __ERROR_LEVELS = """\
832
+ NONE=0
833
+ WARNING=1
834
+ ERROR=2
835
+ FATAL=3
836
+ """
837
+
838
+ cdef object __ERROR_DOMAINS = """\
839
+ NONE=0
840
+ PARSER=1
841
+ TREE=2
842
+ NAMESPACE=3
843
+ DTD=4
844
+ HTML=5
845
+ MEMORY=6
846
+ OUTPUT=7
847
+ IO=8
848
+ FTP=9
849
+ HTTP=10
850
+ XINCLUDE=11
851
+ XPATH=12
852
+ XPOINTER=13
853
+ REGEXP=14
854
+ DATATYPE=15
855
+ SCHEMASP=16
856
+ SCHEMASV=17
857
+ RELAXNGP=18
858
+ RELAXNGV=19
859
+ CATALOG=20
860
+ C14N=21
861
+ XSLT=22
862
+ VALID=23
863
+ CHECK=24
864
+ WRITER=25
865
+ MODULE=26
866
+ I18N=27
867
+ SCHEMATRONV=28
868
+ BUFFER=29
869
+ URI=30
870
+ """
871
+
872
+ cdef object __PARSER_ERROR_TYPES = """\
873
+ ERR_OK=0
874
+ ERR_INTERNAL_ERROR=1
875
+ ERR_NO_MEMORY=2
876
+ ERR_DOCUMENT_START=3
877
+ ERR_DOCUMENT_EMPTY=4
878
+ ERR_DOCUMENT_END=5
879
+ ERR_INVALID_HEX_CHARREF=6
880
+ ERR_INVALID_DEC_CHARREF=7
881
+ ERR_INVALID_CHARREF=8
882
+ ERR_INVALID_CHAR=9
883
+ ERR_CHARREF_AT_EOF=10
884
+ ERR_CHARREF_IN_PROLOG=11
885
+ ERR_CHARREF_IN_EPILOG=12
886
+ ERR_CHARREF_IN_DTD=13
887
+ ERR_ENTITYREF_AT_EOF=14
888
+ ERR_ENTITYREF_IN_PROLOG=15
889
+ ERR_ENTITYREF_IN_EPILOG=16
890
+ ERR_ENTITYREF_IN_DTD=17
891
+ ERR_PEREF_AT_EOF=18
892
+ ERR_PEREF_IN_PROLOG=19
893
+ ERR_PEREF_IN_EPILOG=20
894
+ ERR_PEREF_IN_INT_SUBSET=21
895
+ ERR_ENTITYREF_NO_NAME=22
896
+ ERR_ENTITYREF_SEMICOL_MISSING=23
897
+ ERR_PEREF_NO_NAME=24
898
+ ERR_PEREF_SEMICOL_MISSING=25
899
+ ERR_UNDECLARED_ENTITY=26
900
+ WAR_UNDECLARED_ENTITY=27
901
+ ERR_UNPARSED_ENTITY=28
902
+ ERR_ENTITY_IS_EXTERNAL=29
903
+ ERR_ENTITY_IS_PARAMETER=30
904
+ ERR_UNKNOWN_ENCODING=31
905
+ ERR_UNSUPPORTED_ENCODING=32
906
+ ERR_STRING_NOT_STARTED=33
907
+ ERR_STRING_NOT_CLOSED=34
908
+ ERR_NS_DECL_ERROR=35
909
+ ERR_ENTITY_NOT_STARTED=36
910
+ ERR_ENTITY_NOT_FINISHED=37
911
+ ERR_LT_IN_ATTRIBUTE=38
912
+ ERR_ATTRIBUTE_NOT_STARTED=39
913
+ ERR_ATTRIBUTE_NOT_FINISHED=40
914
+ ERR_ATTRIBUTE_WITHOUT_VALUE=41
915
+ ERR_ATTRIBUTE_REDEFINED=42
916
+ ERR_LITERAL_NOT_STARTED=43
917
+ ERR_LITERAL_NOT_FINISHED=44
918
+ ERR_COMMENT_NOT_FINISHED=45
919
+ ERR_PI_NOT_STARTED=46
920
+ ERR_PI_NOT_FINISHED=47
921
+ ERR_NOTATION_NOT_STARTED=48
922
+ ERR_NOTATION_NOT_FINISHED=49
923
+ ERR_ATTLIST_NOT_STARTED=50
924
+ ERR_ATTLIST_NOT_FINISHED=51
925
+ ERR_MIXED_NOT_STARTED=52
926
+ ERR_MIXED_NOT_FINISHED=53
927
+ ERR_ELEMCONTENT_NOT_STARTED=54
928
+ ERR_ELEMCONTENT_NOT_FINISHED=55
929
+ ERR_XMLDECL_NOT_STARTED=56
930
+ ERR_XMLDECL_NOT_FINISHED=57
931
+ ERR_CONDSEC_NOT_STARTED=58
932
+ ERR_CONDSEC_NOT_FINISHED=59
933
+ ERR_EXT_SUBSET_NOT_FINISHED=60
934
+ ERR_DOCTYPE_NOT_FINISHED=61
935
+ ERR_MISPLACED_CDATA_END=62
936
+ ERR_CDATA_NOT_FINISHED=63
937
+ ERR_RESERVED_XML_NAME=64
938
+ ERR_SPACE_REQUIRED=65
939
+ ERR_SEPARATOR_REQUIRED=66
940
+ ERR_NMTOKEN_REQUIRED=67
941
+ ERR_NAME_REQUIRED=68
942
+ ERR_PCDATA_REQUIRED=69
943
+ ERR_URI_REQUIRED=70
944
+ ERR_PUBID_REQUIRED=71
945
+ ERR_LT_REQUIRED=72
946
+ ERR_GT_REQUIRED=73
947
+ ERR_LTSLASH_REQUIRED=74
948
+ ERR_EQUAL_REQUIRED=75
949
+ ERR_TAG_NAME_MISMATCH=76
950
+ ERR_TAG_NOT_FINISHED=77
951
+ ERR_STANDALONE_VALUE=78
952
+ ERR_ENCODING_NAME=79
953
+ ERR_HYPHEN_IN_COMMENT=80
954
+ ERR_INVALID_ENCODING=81
955
+ ERR_EXT_ENTITY_STANDALONE=82
956
+ ERR_CONDSEC_INVALID=83
957
+ ERR_VALUE_REQUIRED=84
958
+ ERR_NOT_WELL_BALANCED=85
959
+ ERR_EXTRA_CONTENT=86
960
+ ERR_ENTITY_CHAR_ERROR=87
961
+ ERR_ENTITY_PE_INTERNAL=88
962
+ ERR_ENTITY_LOOP=89
963
+ ERR_ENTITY_BOUNDARY=90
964
+ ERR_INVALID_URI=91
965
+ ERR_URI_FRAGMENT=92
966
+ WAR_CATALOG_PI=93
967
+ ERR_NO_DTD=94
968
+ ERR_CONDSEC_INVALID_KEYWORD=95
969
+ ERR_VERSION_MISSING=96
970
+ WAR_UNKNOWN_VERSION=97
971
+ WAR_LANG_VALUE=98
972
+ WAR_NS_URI=99
973
+ WAR_NS_URI_RELATIVE=100
974
+ ERR_MISSING_ENCODING=101
975
+ WAR_SPACE_VALUE=102
976
+ ERR_NOT_STANDALONE=103
977
+ ERR_ENTITY_PROCESSING=104
978
+ ERR_NOTATION_PROCESSING=105
979
+ WAR_NS_COLUMN=106
980
+ WAR_ENTITY_REDEFINED=107
981
+ ERR_UNKNOWN_VERSION=108
982
+ ERR_VERSION_MISMATCH=109
983
+ ERR_NAME_TOO_LONG=110
984
+ ERR_USER_STOP=111
985
+ ERR_COMMENT_ABRUPTLY_ENDED=112
986
+ NS_ERR_XML_NAMESPACE=200
987
+ NS_ERR_UNDEFINED_NAMESPACE=201
988
+ NS_ERR_QNAME=202
989
+ NS_ERR_ATTRIBUTE_REDEFINED=203
990
+ NS_ERR_EMPTY=204
991
+ NS_ERR_COLON=205
992
+ DTD_ATTRIBUTE_DEFAULT=500
993
+ DTD_ATTRIBUTE_REDEFINED=501
994
+ DTD_ATTRIBUTE_VALUE=502
995
+ DTD_CONTENT_ERROR=503
996
+ DTD_CONTENT_MODEL=504
997
+ DTD_CONTENT_NOT_DETERMINIST=505
998
+ DTD_DIFFERENT_PREFIX=506
999
+ DTD_ELEM_DEFAULT_NAMESPACE=507
1000
+ DTD_ELEM_NAMESPACE=508
1001
+ DTD_ELEM_REDEFINED=509
1002
+ DTD_EMPTY_NOTATION=510
1003
+ DTD_ENTITY_TYPE=511
1004
+ DTD_ID_FIXED=512
1005
+ DTD_ID_REDEFINED=513
1006
+ DTD_ID_SUBSET=514
1007
+ DTD_INVALID_CHILD=515
1008
+ DTD_INVALID_DEFAULT=516
1009
+ DTD_LOAD_ERROR=517
1010
+ DTD_MISSING_ATTRIBUTE=518
1011
+ DTD_MIXED_CORRUPT=519
1012
+ DTD_MULTIPLE_ID=520
1013
+ DTD_NO_DOC=521
1014
+ DTD_NO_DTD=522
1015
+ DTD_NO_ELEM_NAME=523
1016
+ DTD_NO_PREFIX=524
1017
+ DTD_NO_ROOT=525
1018
+ DTD_NOTATION_REDEFINED=526
1019
+ DTD_NOTATION_VALUE=527
1020
+ DTD_NOT_EMPTY=528
1021
+ DTD_NOT_PCDATA=529
1022
+ DTD_NOT_STANDALONE=530
1023
+ DTD_ROOT_NAME=531
1024
+ DTD_STANDALONE_WHITE_SPACE=532
1025
+ DTD_UNKNOWN_ATTRIBUTE=533
1026
+ DTD_UNKNOWN_ELEM=534
1027
+ DTD_UNKNOWN_ENTITY=535
1028
+ DTD_UNKNOWN_ID=536
1029
+ DTD_UNKNOWN_NOTATION=537
1030
+ DTD_STANDALONE_DEFAULTED=538
1031
+ DTD_XMLID_VALUE=539
1032
+ DTD_XMLID_TYPE=540
1033
+ DTD_DUP_TOKEN=541
1034
+ HTML_STRUCURE_ERROR=800
1035
+ HTML_UNKNOWN_TAG=801
1036
+ RNGP_ANYNAME_ATTR_ANCESTOR=1000
1037
+ RNGP_ATTR_CONFLICT=1001
1038
+ RNGP_ATTRIBUTE_CHILDREN=1002
1039
+ RNGP_ATTRIBUTE_CONTENT=1003
1040
+ RNGP_ATTRIBUTE_EMPTY=1004
1041
+ RNGP_ATTRIBUTE_NOOP=1005
1042
+ RNGP_CHOICE_CONTENT=1006
1043
+ RNGP_CHOICE_EMPTY=1007
1044
+ RNGP_CREATE_FAILURE=1008
1045
+ RNGP_DATA_CONTENT=1009
1046
+ RNGP_DEF_CHOICE_AND_INTERLEAVE=1010
1047
+ RNGP_DEFINE_CREATE_FAILED=1011
1048
+ RNGP_DEFINE_EMPTY=1012
1049
+ RNGP_DEFINE_MISSING=1013
1050
+ RNGP_DEFINE_NAME_MISSING=1014
1051
+ RNGP_ELEM_CONTENT_EMPTY=1015
1052
+ RNGP_ELEM_CONTENT_ERROR=1016
1053
+ RNGP_ELEMENT_EMPTY=1017
1054
+ RNGP_ELEMENT_CONTENT=1018
1055
+ RNGP_ELEMENT_NAME=1019
1056
+ RNGP_ELEMENT_NO_CONTENT=1020
1057
+ RNGP_ELEM_TEXT_CONFLICT=1021
1058
+ RNGP_EMPTY=1022
1059
+ RNGP_EMPTY_CONSTRUCT=1023
1060
+ RNGP_EMPTY_CONTENT=1024
1061
+ RNGP_EMPTY_NOT_EMPTY=1025
1062
+ RNGP_ERROR_TYPE_LIB=1026
1063
+ RNGP_EXCEPT_EMPTY=1027
1064
+ RNGP_EXCEPT_MISSING=1028
1065
+ RNGP_EXCEPT_MULTIPLE=1029
1066
+ RNGP_EXCEPT_NO_CONTENT=1030
1067
+ RNGP_EXTERNALREF_EMTPY=1031
1068
+ RNGP_EXTERNAL_REF_FAILURE=1032
1069
+ RNGP_EXTERNALREF_RECURSE=1033
1070
+ RNGP_FORBIDDEN_ATTRIBUTE=1034
1071
+ RNGP_FOREIGN_ELEMENT=1035
1072
+ RNGP_GRAMMAR_CONTENT=1036
1073
+ RNGP_GRAMMAR_EMPTY=1037
1074
+ RNGP_GRAMMAR_MISSING=1038
1075
+ RNGP_GRAMMAR_NO_START=1039
1076
+ RNGP_GROUP_ATTR_CONFLICT=1040
1077
+ RNGP_HREF_ERROR=1041
1078
+ RNGP_INCLUDE_EMPTY=1042
1079
+ RNGP_INCLUDE_FAILURE=1043
1080
+ RNGP_INCLUDE_RECURSE=1044
1081
+ RNGP_INTERLEAVE_ADD=1045
1082
+ RNGP_INTERLEAVE_CREATE_FAILED=1046
1083
+ RNGP_INTERLEAVE_EMPTY=1047
1084
+ RNGP_INTERLEAVE_NO_CONTENT=1048
1085
+ RNGP_INVALID_DEFINE_NAME=1049
1086
+ RNGP_INVALID_URI=1050
1087
+ RNGP_INVALID_VALUE=1051
1088
+ RNGP_MISSING_HREF=1052
1089
+ RNGP_NAME_MISSING=1053
1090
+ RNGP_NEED_COMBINE=1054
1091
+ RNGP_NOTALLOWED_NOT_EMPTY=1055
1092
+ RNGP_NSNAME_ATTR_ANCESTOR=1056
1093
+ RNGP_NSNAME_NO_NS=1057
1094
+ RNGP_PARAM_FORBIDDEN=1058
1095
+ RNGP_PARAM_NAME_MISSING=1059
1096
+ RNGP_PARENTREF_CREATE_FAILED=1060
1097
+ RNGP_PARENTREF_NAME_INVALID=1061
1098
+ RNGP_PARENTREF_NO_NAME=1062
1099
+ RNGP_PARENTREF_NO_PARENT=1063
1100
+ RNGP_PARENTREF_NOT_EMPTY=1064
1101
+ RNGP_PARSE_ERROR=1065
1102
+ RNGP_PAT_ANYNAME_EXCEPT_ANYNAME=1066
1103
+ RNGP_PAT_ATTR_ATTR=1067
1104
+ RNGP_PAT_ATTR_ELEM=1068
1105
+ RNGP_PAT_DATA_EXCEPT_ATTR=1069
1106
+ RNGP_PAT_DATA_EXCEPT_ELEM=1070
1107
+ RNGP_PAT_DATA_EXCEPT_EMPTY=1071
1108
+ RNGP_PAT_DATA_EXCEPT_GROUP=1072
1109
+ RNGP_PAT_DATA_EXCEPT_INTERLEAVE=1073
1110
+ RNGP_PAT_DATA_EXCEPT_LIST=1074
1111
+ RNGP_PAT_DATA_EXCEPT_ONEMORE=1075
1112
+ RNGP_PAT_DATA_EXCEPT_REF=1076
1113
+ RNGP_PAT_DATA_EXCEPT_TEXT=1077
1114
+ RNGP_PAT_LIST_ATTR=1078
1115
+ RNGP_PAT_LIST_ELEM=1079
1116
+ RNGP_PAT_LIST_INTERLEAVE=1080
1117
+ RNGP_PAT_LIST_LIST=1081
1118
+ RNGP_PAT_LIST_REF=1082
1119
+ RNGP_PAT_LIST_TEXT=1083
1120
+ RNGP_PAT_NSNAME_EXCEPT_ANYNAME=1084
1121
+ RNGP_PAT_NSNAME_EXCEPT_NSNAME=1085
1122
+ RNGP_PAT_ONEMORE_GROUP_ATTR=1086
1123
+ RNGP_PAT_ONEMORE_INTERLEAVE_ATTR=1087
1124
+ RNGP_PAT_START_ATTR=1088
1125
+ RNGP_PAT_START_DATA=1089
1126
+ RNGP_PAT_START_EMPTY=1090
1127
+ RNGP_PAT_START_GROUP=1091
1128
+ RNGP_PAT_START_INTERLEAVE=1092
1129
+ RNGP_PAT_START_LIST=1093
1130
+ RNGP_PAT_START_ONEMORE=1094
1131
+ RNGP_PAT_START_TEXT=1095
1132
+ RNGP_PAT_START_VALUE=1096
1133
+ RNGP_PREFIX_UNDEFINED=1097
1134
+ RNGP_REF_CREATE_FAILED=1098
1135
+ RNGP_REF_CYCLE=1099
1136
+ RNGP_REF_NAME_INVALID=1100
1137
+ RNGP_REF_NO_DEF=1101
1138
+ RNGP_REF_NO_NAME=1102
1139
+ RNGP_REF_NOT_EMPTY=1103
1140
+ RNGP_START_CHOICE_AND_INTERLEAVE=1104
1141
+ RNGP_START_CONTENT=1105
1142
+ RNGP_START_EMPTY=1106
1143
+ RNGP_START_MISSING=1107
1144
+ RNGP_TEXT_EXPECTED=1108
1145
+ RNGP_TEXT_HAS_CHILD=1109
1146
+ RNGP_TYPE_MISSING=1110
1147
+ RNGP_TYPE_NOT_FOUND=1111
1148
+ RNGP_TYPE_VALUE=1112
1149
+ RNGP_UNKNOWN_ATTRIBUTE=1113
1150
+ RNGP_UNKNOWN_COMBINE=1114
1151
+ RNGP_UNKNOWN_CONSTRUCT=1115
1152
+ RNGP_UNKNOWN_TYPE_LIB=1116
1153
+ RNGP_URI_FRAGMENT=1117
1154
+ RNGP_URI_NOT_ABSOLUTE=1118
1155
+ RNGP_VALUE_EMPTY=1119
1156
+ RNGP_VALUE_NO_CONTENT=1120
1157
+ RNGP_XMLNS_NAME=1121
1158
+ RNGP_XML_NS=1122
1159
+ XPATH_EXPRESSION_OK=1200
1160
+ XPATH_NUMBER_ERROR=1201
1161
+ XPATH_UNFINISHED_LITERAL_ERROR=1202
1162
+ XPATH_START_LITERAL_ERROR=1203
1163
+ XPATH_VARIABLE_REF_ERROR=1204
1164
+ XPATH_UNDEF_VARIABLE_ERROR=1205
1165
+ XPATH_INVALID_PREDICATE_ERROR=1206
1166
+ XPATH_EXPR_ERROR=1207
1167
+ XPATH_UNCLOSED_ERROR=1208
1168
+ XPATH_UNKNOWN_FUNC_ERROR=1209
1169
+ XPATH_INVALID_OPERAND=1210
1170
+ XPATH_INVALID_TYPE=1211
1171
+ XPATH_INVALID_ARITY=1212
1172
+ XPATH_INVALID_CTXT_SIZE=1213
1173
+ XPATH_INVALID_CTXT_POSITION=1214
1174
+ XPATH_MEMORY_ERROR=1215
1175
+ XPTR_SYNTAX_ERROR=1216
1176
+ XPTR_RESOURCE_ERROR=1217
1177
+ XPTR_SUB_RESOURCE_ERROR=1218
1178
+ XPATH_UNDEF_PREFIX_ERROR=1219
1179
+ XPATH_ENCODING_ERROR=1220
1180
+ XPATH_INVALID_CHAR_ERROR=1221
1181
+ TREE_INVALID_HEX=1300
1182
+ TREE_INVALID_DEC=1301
1183
+ TREE_UNTERMINATED_ENTITY=1302
1184
+ TREE_NOT_UTF8=1303
1185
+ SAVE_NOT_UTF8=1400
1186
+ SAVE_CHAR_INVALID=1401
1187
+ SAVE_NO_DOCTYPE=1402
1188
+ SAVE_UNKNOWN_ENCODING=1403
1189
+ REGEXP_COMPILE_ERROR=1450
1190
+ IO_UNKNOWN=1500
1191
+ IO_EACCES=1501
1192
+ IO_EAGAIN=1502
1193
+ IO_EBADF=1503
1194
+ IO_EBADMSG=1504
1195
+ IO_EBUSY=1505
1196
+ IO_ECANCELED=1506
1197
+ IO_ECHILD=1507
1198
+ IO_EDEADLK=1508
1199
+ IO_EDOM=1509
1200
+ IO_EEXIST=1510
1201
+ IO_EFAULT=1511
1202
+ IO_EFBIG=1512
1203
+ IO_EINPROGRESS=1513
1204
+ IO_EINTR=1514
1205
+ IO_EINVAL=1515
1206
+ IO_EIO=1516
1207
+ IO_EISDIR=1517
1208
+ IO_EMFILE=1518
1209
+ IO_EMLINK=1519
1210
+ IO_EMSGSIZE=1520
1211
+ IO_ENAMETOOLONG=1521
1212
+ IO_ENFILE=1522
1213
+ IO_ENODEV=1523
1214
+ IO_ENOENT=1524
1215
+ IO_ENOEXEC=1525
1216
+ IO_ENOLCK=1526
1217
+ IO_ENOMEM=1527
1218
+ IO_ENOSPC=1528
1219
+ IO_ENOSYS=1529
1220
+ IO_ENOTDIR=1530
1221
+ IO_ENOTEMPTY=1531
1222
+ IO_ENOTSUP=1532
1223
+ IO_ENOTTY=1533
1224
+ IO_ENXIO=1534
1225
+ IO_EPERM=1535
1226
+ IO_EPIPE=1536
1227
+ IO_ERANGE=1537
1228
+ IO_EROFS=1538
1229
+ IO_ESPIPE=1539
1230
+ IO_ESRCH=1540
1231
+ IO_ETIMEDOUT=1541
1232
+ IO_EXDEV=1542
1233
+ IO_NETWORK_ATTEMPT=1543
1234
+ IO_ENCODER=1544
1235
+ IO_FLUSH=1545
1236
+ IO_WRITE=1546
1237
+ IO_NO_INPUT=1547
1238
+ IO_BUFFER_FULL=1548
1239
+ IO_LOAD_ERROR=1549
1240
+ IO_ENOTSOCK=1550
1241
+ IO_EISCONN=1551
1242
+ IO_ECONNREFUSED=1552
1243
+ IO_ENETUNREACH=1553
1244
+ IO_EADDRINUSE=1554
1245
+ IO_EALREADY=1555
1246
+ IO_EAFNOSUPPORT=1556
1247
+ XINCLUDE_RECURSION=1600
1248
+ XINCLUDE_PARSE_VALUE=1601
1249
+ XINCLUDE_ENTITY_DEF_MISMATCH=1602
1250
+ XINCLUDE_NO_HREF=1603
1251
+ XINCLUDE_NO_FALLBACK=1604
1252
+ XINCLUDE_HREF_URI=1605
1253
+ XINCLUDE_TEXT_FRAGMENT=1606
1254
+ XINCLUDE_TEXT_DOCUMENT=1607
1255
+ XINCLUDE_INVALID_CHAR=1608
1256
+ XINCLUDE_BUILD_FAILED=1609
1257
+ XINCLUDE_UNKNOWN_ENCODING=1610
1258
+ XINCLUDE_MULTIPLE_ROOT=1611
1259
+ XINCLUDE_XPTR_FAILED=1612
1260
+ XINCLUDE_XPTR_RESULT=1613
1261
+ XINCLUDE_INCLUDE_IN_INCLUDE=1614
1262
+ XINCLUDE_FALLBACKS_IN_INCLUDE=1615
1263
+ XINCLUDE_FALLBACK_NOT_IN_INCLUDE=1616
1264
+ XINCLUDE_DEPRECATED_NS=1617
1265
+ XINCLUDE_FRAGMENT_ID=1618
1266
+ CATALOG_MISSING_ATTR=1650
1267
+ CATALOG_ENTRY_BROKEN=1651
1268
+ CATALOG_PREFER_VALUE=1652
1269
+ CATALOG_NOT_CATALOG=1653
1270
+ CATALOG_RECURSION=1654
1271
+ SCHEMAP_PREFIX_UNDEFINED=1700
1272
+ SCHEMAP_ATTRFORMDEFAULT_VALUE=1701
1273
+ SCHEMAP_ATTRGRP_NONAME_NOREF=1702
1274
+ SCHEMAP_ATTR_NONAME_NOREF=1703
1275
+ SCHEMAP_COMPLEXTYPE_NONAME_NOREF=1704
1276
+ SCHEMAP_ELEMFORMDEFAULT_VALUE=1705
1277
+ SCHEMAP_ELEM_NONAME_NOREF=1706
1278
+ SCHEMAP_EXTENSION_NO_BASE=1707
1279
+ SCHEMAP_FACET_NO_VALUE=1708
1280
+ SCHEMAP_FAILED_BUILD_IMPORT=1709
1281
+ SCHEMAP_GROUP_NONAME_NOREF=1710
1282
+ SCHEMAP_IMPORT_NAMESPACE_NOT_URI=1711
1283
+ SCHEMAP_IMPORT_REDEFINE_NSNAME=1712
1284
+ SCHEMAP_IMPORT_SCHEMA_NOT_URI=1713
1285
+ SCHEMAP_INVALID_BOOLEAN=1714
1286
+ SCHEMAP_INVALID_ENUM=1715
1287
+ SCHEMAP_INVALID_FACET=1716
1288
+ SCHEMAP_INVALID_FACET_VALUE=1717
1289
+ SCHEMAP_INVALID_MAXOCCURS=1718
1290
+ SCHEMAP_INVALID_MINOCCURS=1719
1291
+ SCHEMAP_INVALID_REF_AND_SUBTYPE=1720
1292
+ SCHEMAP_INVALID_WHITE_SPACE=1721
1293
+ SCHEMAP_NOATTR_NOREF=1722
1294
+ SCHEMAP_NOTATION_NO_NAME=1723
1295
+ SCHEMAP_NOTYPE_NOREF=1724
1296
+ SCHEMAP_REF_AND_SUBTYPE=1725
1297
+ SCHEMAP_RESTRICTION_NONAME_NOREF=1726
1298
+ SCHEMAP_SIMPLETYPE_NONAME=1727
1299
+ SCHEMAP_TYPE_AND_SUBTYPE=1728
1300
+ SCHEMAP_UNKNOWN_ALL_CHILD=1729
1301
+ SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD=1730
1302
+ SCHEMAP_UNKNOWN_ATTR_CHILD=1731
1303
+ SCHEMAP_UNKNOWN_ATTRGRP_CHILD=1732
1304
+ SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP=1733
1305
+ SCHEMAP_UNKNOWN_BASE_TYPE=1734
1306
+ SCHEMAP_UNKNOWN_CHOICE_CHILD=1735
1307
+ SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD=1736
1308
+ SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD=1737
1309
+ SCHEMAP_UNKNOWN_ELEM_CHILD=1738
1310
+ SCHEMAP_UNKNOWN_EXTENSION_CHILD=1739
1311
+ SCHEMAP_UNKNOWN_FACET_CHILD=1740
1312
+ SCHEMAP_UNKNOWN_FACET_TYPE=1741
1313
+ SCHEMAP_UNKNOWN_GROUP_CHILD=1742
1314
+ SCHEMAP_UNKNOWN_IMPORT_CHILD=1743
1315
+ SCHEMAP_UNKNOWN_LIST_CHILD=1744
1316
+ SCHEMAP_UNKNOWN_NOTATION_CHILD=1745
1317
+ SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD=1746
1318
+ SCHEMAP_UNKNOWN_REF=1747
1319
+ SCHEMAP_UNKNOWN_RESTRICTION_CHILD=1748
1320
+ SCHEMAP_UNKNOWN_SCHEMAS_CHILD=1749
1321
+ SCHEMAP_UNKNOWN_SEQUENCE_CHILD=1750
1322
+ SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD=1751
1323
+ SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD=1752
1324
+ SCHEMAP_UNKNOWN_TYPE=1753
1325
+ SCHEMAP_UNKNOWN_UNION_CHILD=1754
1326
+ SCHEMAP_ELEM_DEFAULT_FIXED=1755
1327
+ SCHEMAP_REGEXP_INVALID=1756
1328
+ SCHEMAP_FAILED_LOAD=1757
1329
+ SCHEMAP_NOTHING_TO_PARSE=1758
1330
+ SCHEMAP_NOROOT=1759
1331
+ SCHEMAP_REDEFINED_GROUP=1760
1332
+ SCHEMAP_REDEFINED_TYPE=1761
1333
+ SCHEMAP_REDEFINED_ELEMENT=1762
1334
+ SCHEMAP_REDEFINED_ATTRGROUP=1763
1335
+ SCHEMAP_REDEFINED_ATTR=1764
1336
+ SCHEMAP_REDEFINED_NOTATION=1765
1337
+ SCHEMAP_FAILED_PARSE=1766
1338
+ SCHEMAP_UNKNOWN_PREFIX=1767
1339
+ SCHEMAP_DEF_AND_PREFIX=1768
1340
+ SCHEMAP_UNKNOWN_INCLUDE_CHILD=1769
1341
+ SCHEMAP_INCLUDE_SCHEMA_NOT_URI=1770
1342
+ SCHEMAP_INCLUDE_SCHEMA_NO_URI=1771
1343
+ SCHEMAP_NOT_SCHEMA=1772
1344
+ SCHEMAP_UNKNOWN_MEMBER_TYPE=1773
1345
+ SCHEMAP_INVALID_ATTR_USE=1774
1346
+ SCHEMAP_RECURSIVE=1775
1347
+ SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE=1776
1348
+ SCHEMAP_INVALID_ATTR_COMBINATION=1777
1349
+ SCHEMAP_INVALID_ATTR_INLINE_COMBINATION=1778
1350
+ SCHEMAP_MISSING_SIMPLETYPE_CHILD=1779
1351
+ SCHEMAP_INVALID_ATTR_NAME=1780
1352
+ SCHEMAP_REF_AND_CONTENT=1781
1353
+ SCHEMAP_CT_PROPS_CORRECT_1=1782
1354
+ SCHEMAP_CT_PROPS_CORRECT_2=1783
1355
+ SCHEMAP_CT_PROPS_CORRECT_3=1784
1356
+ SCHEMAP_CT_PROPS_CORRECT_4=1785
1357
+ SCHEMAP_CT_PROPS_CORRECT_5=1786
1358
+ SCHEMAP_DERIVATION_OK_RESTRICTION_1=1787
1359
+ SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1=1788
1360
+ SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2=1789
1361
+ SCHEMAP_DERIVATION_OK_RESTRICTION_2_2=1790
1362
+ SCHEMAP_DERIVATION_OK_RESTRICTION_3=1791
1363
+ SCHEMAP_WILDCARD_INVALID_NS_MEMBER=1792
1364
+ SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE=1793
1365
+ SCHEMAP_UNION_NOT_EXPRESSIBLE=1794
1366
+ SCHEMAP_SRC_IMPORT_3_1=1795
1367
+ SCHEMAP_SRC_IMPORT_3_2=1796
1368
+ SCHEMAP_DERIVATION_OK_RESTRICTION_4_1=1797
1369
+ SCHEMAP_DERIVATION_OK_RESTRICTION_4_2=1798
1370
+ SCHEMAP_DERIVATION_OK_RESTRICTION_4_3=1799
1371
+ SCHEMAP_COS_CT_EXTENDS_1_3=1800
1372
+ SCHEMAV_NOROOT=1801
1373
+ SCHEMAV_UNDECLAREDELEM=1802
1374
+ SCHEMAV_NOTTOPLEVEL=1803
1375
+ SCHEMAV_MISSING=1804
1376
+ SCHEMAV_WRONGELEM=1805
1377
+ SCHEMAV_NOTYPE=1806
1378
+ SCHEMAV_NOROLLBACK=1807
1379
+ SCHEMAV_ISABSTRACT=1808
1380
+ SCHEMAV_NOTEMPTY=1809
1381
+ SCHEMAV_ELEMCONT=1810
1382
+ SCHEMAV_HAVEDEFAULT=1811
1383
+ SCHEMAV_NOTNILLABLE=1812
1384
+ SCHEMAV_EXTRACONTENT=1813
1385
+ SCHEMAV_INVALIDATTR=1814
1386
+ SCHEMAV_INVALIDELEM=1815
1387
+ SCHEMAV_NOTDETERMINIST=1816
1388
+ SCHEMAV_CONSTRUCT=1817
1389
+ SCHEMAV_INTERNAL=1818
1390
+ SCHEMAV_NOTSIMPLE=1819
1391
+ SCHEMAV_ATTRUNKNOWN=1820
1392
+ SCHEMAV_ATTRINVALID=1821
1393
+ SCHEMAV_VALUE=1822
1394
+ SCHEMAV_FACET=1823
1395
+ SCHEMAV_CVC_DATATYPE_VALID_1_2_1=1824
1396
+ SCHEMAV_CVC_DATATYPE_VALID_1_2_2=1825
1397
+ SCHEMAV_CVC_DATATYPE_VALID_1_2_3=1826
1398
+ SCHEMAV_CVC_TYPE_3_1_1=1827
1399
+ SCHEMAV_CVC_TYPE_3_1_2=1828
1400
+ SCHEMAV_CVC_FACET_VALID=1829
1401
+ SCHEMAV_CVC_LENGTH_VALID=1830
1402
+ SCHEMAV_CVC_MINLENGTH_VALID=1831
1403
+ SCHEMAV_CVC_MAXLENGTH_VALID=1832
1404
+ SCHEMAV_CVC_MININCLUSIVE_VALID=1833
1405
+ SCHEMAV_CVC_MAXINCLUSIVE_VALID=1834
1406
+ SCHEMAV_CVC_MINEXCLUSIVE_VALID=1835
1407
+ SCHEMAV_CVC_MAXEXCLUSIVE_VALID=1836
1408
+ SCHEMAV_CVC_TOTALDIGITS_VALID=1837
1409
+ SCHEMAV_CVC_FRACTIONDIGITS_VALID=1838
1410
+ SCHEMAV_CVC_PATTERN_VALID=1839
1411
+ SCHEMAV_CVC_ENUMERATION_VALID=1840
1412
+ SCHEMAV_CVC_COMPLEX_TYPE_2_1=1841
1413
+ SCHEMAV_CVC_COMPLEX_TYPE_2_2=1842
1414
+ SCHEMAV_CVC_COMPLEX_TYPE_2_3=1843
1415
+ SCHEMAV_CVC_COMPLEX_TYPE_2_4=1844
1416
+ SCHEMAV_CVC_ELT_1=1845
1417
+ SCHEMAV_CVC_ELT_2=1846
1418
+ SCHEMAV_CVC_ELT_3_1=1847
1419
+ SCHEMAV_CVC_ELT_3_2_1=1848
1420
+ SCHEMAV_CVC_ELT_3_2_2=1849
1421
+ SCHEMAV_CVC_ELT_4_1=1850
1422
+ SCHEMAV_CVC_ELT_4_2=1851
1423
+ SCHEMAV_CVC_ELT_4_3=1852
1424
+ SCHEMAV_CVC_ELT_5_1_1=1853
1425
+ SCHEMAV_CVC_ELT_5_1_2=1854
1426
+ SCHEMAV_CVC_ELT_5_2_1=1855
1427
+ SCHEMAV_CVC_ELT_5_2_2_1=1856
1428
+ SCHEMAV_CVC_ELT_5_2_2_2_1=1857
1429
+ SCHEMAV_CVC_ELT_5_2_2_2_2=1858
1430
+ SCHEMAV_CVC_ELT_6=1859
1431
+ SCHEMAV_CVC_ELT_7=1860
1432
+ SCHEMAV_CVC_ATTRIBUTE_1=1861
1433
+ SCHEMAV_CVC_ATTRIBUTE_2=1862
1434
+ SCHEMAV_CVC_ATTRIBUTE_3=1863
1435
+ SCHEMAV_CVC_ATTRIBUTE_4=1864
1436
+ SCHEMAV_CVC_COMPLEX_TYPE_3_1=1865
1437
+ SCHEMAV_CVC_COMPLEX_TYPE_3_2_1=1866
1438
+ SCHEMAV_CVC_COMPLEX_TYPE_3_2_2=1867
1439
+ SCHEMAV_CVC_COMPLEX_TYPE_4=1868
1440
+ SCHEMAV_CVC_COMPLEX_TYPE_5_1=1869
1441
+ SCHEMAV_CVC_COMPLEX_TYPE_5_2=1870
1442
+ SCHEMAV_ELEMENT_CONTENT=1871
1443
+ SCHEMAV_DOCUMENT_ELEMENT_MISSING=1872
1444
+ SCHEMAV_CVC_COMPLEX_TYPE_1=1873
1445
+ SCHEMAV_CVC_AU=1874
1446
+ SCHEMAV_CVC_TYPE_1=1875
1447
+ SCHEMAV_CVC_TYPE_2=1876
1448
+ SCHEMAV_CVC_IDC=1877
1449
+ SCHEMAV_CVC_WILDCARD=1878
1450
+ SCHEMAV_MISC=1879
1451
+ XPTR_UNKNOWN_SCHEME=1900
1452
+ XPTR_CHILDSEQ_START=1901
1453
+ XPTR_EVAL_FAILED=1902
1454
+ XPTR_EXTRA_OBJECTS=1903
1455
+ C14N_CREATE_CTXT=1950
1456
+ C14N_REQUIRES_UTF8=1951
1457
+ C14N_CREATE_STACK=1952
1458
+ C14N_INVALID_NODE=1953
1459
+ C14N_UNKNOW_NODE=1954
1460
+ C14N_RELATIVE_NAMESPACE=1955
1461
+ FTP_PASV_ANSWER=2000
1462
+ FTP_EPSV_ANSWER=2001
1463
+ FTP_ACCNT=2002
1464
+ FTP_URL_SYNTAX=2003
1465
+ HTTP_URL_SYNTAX=2020
1466
+ HTTP_USE_IP=2021
1467
+ HTTP_UNKNOWN_HOST=2022
1468
+ SCHEMAP_SRC_SIMPLE_TYPE_1=3000
1469
+ SCHEMAP_SRC_SIMPLE_TYPE_2=3001
1470
+ SCHEMAP_SRC_SIMPLE_TYPE_3=3002
1471
+ SCHEMAP_SRC_SIMPLE_TYPE_4=3003
1472
+ SCHEMAP_SRC_RESOLVE=3004
1473
+ SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE=3005
1474
+ SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE=3006
1475
+ SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES=3007
1476
+ SCHEMAP_ST_PROPS_CORRECT_1=3008
1477
+ SCHEMAP_ST_PROPS_CORRECT_2=3009
1478
+ SCHEMAP_ST_PROPS_CORRECT_3=3010
1479
+ SCHEMAP_COS_ST_RESTRICTS_1_1=3011
1480
+ SCHEMAP_COS_ST_RESTRICTS_1_2=3012
1481
+ SCHEMAP_COS_ST_RESTRICTS_1_3_1=3013
1482
+ SCHEMAP_COS_ST_RESTRICTS_1_3_2=3014
1483
+ SCHEMAP_COS_ST_RESTRICTS_2_1=3015
1484
+ SCHEMAP_COS_ST_RESTRICTS_2_3_1_1=3016
1485
+ SCHEMAP_COS_ST_RESTRICTS_2_3_1_2=3017
1486
+ SCHEMAP_COS_ST_RESTRICTS_2_3_2_1=3018
1487
+ SCHEMAP_COS_ST_RESTRICTS_2_3_2_2=3019
1488
+ SCHEMAP_COS_ST_RESTRICTS_2_3_2_3=3020
1489
+ SCHEMAP_COS_ST_RESTRICTS_2_3_2_4=3021
1490
+ SCHEMAP_COS_ST_RESTRICTS_2_3_2_5=3022
1491
+ SCHEMAP_COS_ST_RESTRICTS_3_1=3023
1492
+ SCHEMAP_COS_ST_RESTRICTS_3_3_1=3024
1493
+ SCHEMAP_COS_ST_RESTRICTS_3_3_1_2=3025
1494
+ SCHEMAP_COS_ST_RESTRICTS_3_3_2_2=3026
1495
+ SCHEMAP_COS_ST_RESTRICTS_3_3_2_1=3027
1496
+ SCHEMAP_COS_ST_RESTRICTS_3_3_2_3=3028
1497
+ SCHEMAP_COS_ST_RESTRICTS_3_3_2_4=3029
1498
+ SCHEMAP_COS_ST_RESTRICTS_3_3_2_5=3030
1499
+ SCHEMAP_COS_ST_DERIVED_OK_2_1=3031
1500
+ SCHEMAP_COS_ST_DERIVED_OK_2_2=3032
1501
+ SCHEMAP_S4S_ELEM_NOT_ALLOWED=3033
1502
+ SCHEMAP_S4S_ELEM_MISSING=3034
1503
+ SCHEMAP_S4S_ATTR_NOT_ALLOWED=3035
1504
+ SCHEMAP_S4S_ATTR_MISSING=3036
1505
+ SCHEMAP_S4S_ATTR_INVALID_VALUE=3037
1506
+ SCHEMAP_SRC_ELEMENT_1=3038
1507
+ SCHEMAP_SRC_ELEMENT_2_1=3039
1508
+ SCHEMAP_SRC_ELEMENT_2_2=3040
1509
+ SCHEMAP_SRC_ELEMENT_3=3041
1510
+ SCHEMAP_P_PROPS_CORRECT_1=3042
1511
+ SCHEMAP_P_PROPS_CORRECT_2_1=3043
1512
+ SCHEMAP_P_PROPS_CORRECT_2_2=3044
1513
+ SCHEMAP_E_PROPS_CORRECT_2=3045
1514
+ SCHEMAP_E_PROPS_CORRECT_3=3046
1515
+ SCHEMAP_E_PROPS_CORRECT_4=3047
1516
+ SCHEMAP_E_PROPS_CORRECT_5=3048
1517
+ SCHEMAP_E_PROPS_CORRECT_6=3049
1518
+ SCHEMAP_SRC_INCLUDE=3050
1519
+ SCHEMAP_SRC_ATTRIBUTE_1=3051
1520
+ SCHEMAP_SRC_ATTRIBUTE_2=3052
1521
+ SCHEMAP_SRC_ATTRIBUTE_3_1=3053
1522
+ SCHEMAP_SRC_ATTRIBUTE_3_2=3054
1523
+ SCHEMAP_SRC_ATTRIBUTE_4=3055
1524
+ SCHEMAP_NO_XMLNS=3056
1525
+ SCHEMAP_NO_XSI=3057
1526
+ SCHEMAP_COS_VALID_DEFAULT_1=3058
1527
+ SCHEMAP_COS_VALID_DEFAULT_2_1=3059
1528
+ SCHEMAP_COS_VALID_DEFAULT_2_2_1=3060
1529
+ SCHEMAP_COS_VALID_DEFAULT_2_2_2=3061
1530
+ SCHEMAP_CVC_SIMPLE_TYPE=3062
1531
+ SCHEMAP_COS_CT_EXTENDS_1_1=3063
1532
+ SCHEMAP_SRC_IMPORT_1_1=3064
1533
+ SCHEMAP_SRC_IMPORT_1_2=3065
1534
+ SCHEMAP_SRC_IMPORT_2=3066
1535
+ SCHEMAP_SRC_IMPORT_2_1=3067
1536
+ SCHEMAP_SRC_IMPORT_2_2=3068
1537
+ SCHEMAP_INTERNAL=3069
1538
+ SCHEMAP_NOT_DETERMINISTIC=3070
1539
+ SCHEMAP_SRC_ATTRIBUTE_GROUP_1=3071
1540
+ SCHEMAP_SRC_ATTRIBUTE_GROUP_2=3072
1541
+ SCHEMAP_SRC_ATTRIBUTE_GROUP_3=3073
1542
+ SCHEMAP_MG_PROPS_CORRECT_1=3074
1543
+ SCHEMAP_MG_PROPS_CORRECT_2=3075
1544
+ SCHEMAP_SRC_CT_1=3076
1545
+ SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3=3077
1546
+ SCHEMAP_AU_PROPS_CORRECT_2=3078
1547
+ SCHEMAP_A_PROPS_CORRECT_2=3079
1548
+ SCHEMAP_C_PROPS_CORRECT=3080
1549
+ SCHEMAP_SRC_REDEFINE=3081
1550
+ SCHEMAP_SRC_IMPORT=3082
1551
+ SCHEMAP_WARN_SKIP_SCHEMA=3083
1552
+ SCHEMAP_WARN_UNLOCATED_SCHEMA=3084
1553
+ SCHEMAP_WARN_ATTR_REDECL_PROH=3085
1554
+ SCHEMAP_WARN_ATTR_POINTLESS_PROH=3086
1555
+ SCHEMAP_AG_PROPS_CORRECT=3087
1556
+ SCHEMAP_COS_CT_EXTENDS_1_2=3088
1557
+ SCHEMAP_AU_PROPS_CORRECT=3089
1558
+ SCHEMAP_A_PROPS_CORRECT_3=3090
1559
+ SCHEMAP_COS_ALL_LIMITED=3091
1560
+ SCHEMATRONV_ASSERT=4000
1561
+ SCHEMATRONV_REPORT=4001
1562
+ MODULE_OPEN=4900
1563
+ MODULE_CLOSE=4901
1564
+ CHECK_FOUND_ELEMENT=5000
1565
+ CHECK_FOUND_ATTRIBUTE=5001
1566
+ CHECK_FOUND_TEXT=5002
1567
+ CHECK_FOUND_CDATA=5003
1568
+ CHECK_FOUND_ENTITYREF=5004
1569
+ CHECK_FOUND_ENTITY=5005
1570
+ CHECK_FOUND_PI=5006
1571
+ CHECK_FOUND_COMMENT=5007
1572
+ CHECK_FOUND_DOCTYPE=5008
1573
+ CHECK_FOUND_FRAGMENT=5009
1574
+ CHECK_FOUND_NOTATION=5010
1575
+ CHECK_UNKNOWN_NODE=5011
1576
+ CHECK_ENTITY_TYPE=5012
1577
+ CHECK_NO_PARENT=5013
1578
+ CHECK_NO_DOC=5014
1579
+ CHECK_NO_NAME=5015
1580
+ CHECK_NO_ELEM=5016
1581
+ CHECK_WRONG_DOC=5017
1582
+ CHECK_NO_PREV=5018
1583
+ CHECK_WRONG_PREV=5019
1584
+ CHECK_NO_NEXT=5020
1585
+ CHECK_WRONG_NEXT=5021
1586
+ CHECK_NOT_DTD=5022
1587
+ CHECK_NOT_ATTR=5023
1588
+ CHECK_NOT_ATTR_DECL=5024
1589
+ CHECK_NOT_ELEM_DECL=5025
1590
+ CHECK_NOT_ENTITY_DECL=5026
1591
+ CHECK_NOT_NS_DECL=5027
1592
+ CHECK_NO_HREF=5028
1593
+ CHECK_WRONG_PARENT=5029
1594
+ CHECK_NS_SCOPE=5030
1595
+ CHECK_NS_ANCESTOR=5031
1596
+ CHECK_NOT_UTF8=5032
1597
+ CHECK_NO_DICT=5033
1598
+ CHECK_NOT_NCNAME=5034
1599
+ CHECK_OUTSIDE_DICT=5035
1600
+ CHECK_WRONG_NAME=5036
1601
+ CHECK_NAME_NOT_NULL=5037
1602
+ I18N_NO_NAME=6000
1603
+ I18N_NO_HANDLER=6001
1604
+ I18N_EXCESS_HANDLER=6002
1605
+ I18N_CONV_FAILED=6003
1606
+ I18N_NO_OUTPUT=6004
1607
+ BUF_OVERFLOW=7000
1608
+ """
1609
+
1610
+ cdef object __RELAXNG_ERROR_TYPES = """\
1611
+ RELAXNG_OK=0
1612
+ RELAXNG_ERR_MEMORY=1
1613
+ RELAXNG_ERR_TYPE=2
1614
+ RELAXNG_ERR_TYPEVAL=3
1615
+ RELAXNG_ERR_DUPID=4
1616
+ RELAXNG_ERR_TYPECMP=5
1617
+ RELAXNG_ERR_NOSTATE=6
1618
+ RELAXNG_ERR_NODEFINE=7
1619
+ RELAXNG_ERR_LISTEXTRA=8
1620
+ RELAXNG_ERR_LISTEMPTY=9
1621
+ RELAXNG_ERR_INTERNODATA=10
1622
+ RELAXNG_ERR_INTERSEQ=11
1623
+ RELAXNG_ERR_INTEREXTRA=12
1624
+ RELAXNG_ERR_ELEMNAME=13
1625
+ RELAXNG_ERR_ATTRNAME=14
1626
+ RELAXNG_ERR_ELEMNONS=15
1627
+ RELAXNG_ERR_ATTRNONS=16
1628
+ RELAXNG_ERR_ELEMWRONGNS=17
1629
+ RELAXNG_ERR_ATTRWRONGNS=18
1630
+ RELAXNG_ERR_ELEMEXTRANS=19
1631
+ RELAXNG_ERR_ATTREXTRANS=20
1632
+ RELAXNG_ERR_ELEMNOTEMPTY=21
1633
+ RELAXNG_ERR_NOELEM=22
1634
+ RELAXNG_ERR_NOTELEM=23
1635
+ RELAXNG_ERR_ATTRVALID=24
1636
+ RELAXNG_ERR_CONTENTVALID=25
1637
+ RELAXNG_ERR_EXTRACONTENT=26
1638
+ RELAXNG_ERR_INVALIDATTR=27
1639
+ RELAXNG_ERR_DATAELEM=28
1640
+ RELAXNG_ERR_VALELEM=29
1641
+ RELAXNG_ERR_LISTELEM=30
1642
+ RELAXNG_ERR_DATATYPE=31
1643
+ RELAXNG_ERR_VALUE=32
1644
+ RELAXNG_ERR_LIST=33
1645
+ RELAXNG_ERR_NOGRAMMAR=34
1646
+ RELAXNG_ERR_EXTRADATA=35
1647
+ RELAXNG_ERR_LACKDATA=36
1648
+ RELAXNG_ERR_INTERNAL=37
1649
+ RELAXNG_ERR_ELEMWRONG=38
1650
+ RELAXNG_ERR_TEXTWRONG=39
1651
+ """
1652
+ # --- END: GENERATED CONSTANTS ---
1653
+
1654
+ __initErrorConstants()