VirtualBox

source: vbox/trunk/src/libs/libxml2-2.9.4/python/libxml2class.py@ 78251

Last change on this file since 78251 was 65950, checked in by vboxsync, 8 years ago

libxml 2.9.4: fix export

  • Property svn:eol-style set to native
File size: 313.7 KB
Line 
1#
2# Functions from module HTMLparser
3#
4
5def htmlCreateMemoryParserCtxt(buffer, size):
6 """Create a parser context for an HTML in-memory document. """
7 ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size)
8 if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed')
9 return parserCtxt(_obj=ret)
10
11def htmlHandleOmittedElem(val):
12 """Set and return the previous value for handling HTML omitted
13 tags. """
14 ret = libxml2mod.htmlHandleOmittedElem(val)
15 return ret
16
17def htmlIsScriptAttribute(name):
18 """Check if an attribute is of content type Script """
19 ret = libxml2mod.htmlIsScriptAttribute(name)
20 return ret
21
22def htmlNewParserCtxt():
23 """Allocate and initialize a new parser context. """
24 ret = libxml2mod.htmlNewParserCtxt()
25 if ret is None:raise parserError('htmlNewParserCtxt() failed')
26 return parserCtxt(_obj=ret)
27
28def htmlParseDoc(cur, encoding):
29 """parse an HTML in-memory document and build a tree. """
30 ret = libxml2mod.htmlParseDoc(cur, encoding)
31 if ret is None:raise parserError('htmlParseDoc() failed')
32 return xmlDoc(_obj=ret)
33
34def htmlParseFile(filename, encoding):
35 """parse an HTML file and build a tree. Automatic support for
36 ZLIB/Compress compressed document is provided by default if
37 found at compile-time. """
38 ret = libxml2mod.htmlParseFile(filename, encoding)
39 if ret is None:raise parserError('htmlParseFile() failed')
40 return xmlDoc(_obj=ret)
41
42def htmlReadDoc(cur, URL, encoding, options):
43 """parse an XML in-memory document and build a tree. """
44 ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
45 if ret is None:raise treeError('htmlReadDoc() failed')
46 return xmlDoc(_obj=ret)
47
48def htmlReadFd(fd, URL, encoding, options):
49 """parse an XML from a file descriptor and build a tree. """
50 ret = libxml2mod.htmlReadFd(fd, URL, encoding, options)
51 if ret is None:raise treeError('htmlReadFd() failed')
52 return xmlDoc(_obj=ret)
53
54def htmlReadFile(filename, encoding, options):
55 """parse an XML file from the filesystem or the network. """
56 ret = libxml2mod.htmlReadFile(filename, encoding, options)
57 if ret is None:raise treeError('htmlReadFile() failed')
58 return xmlDoc(_obj=ret)
59
60def htmlReadMemory(buffer, size, URL, encoding, options):
61 """parse an XML in-memory document and build a tree. """
62 ret = libxml2mod.htmlReadMemory(buffer, size, URL, encoding, options)
63 if ret is None:raise treeError('htmlReadMemory() failed')
64 return xmlDoc(_obj=ret)
65
66#
67# Functions from module HTMLtree
68#
69
70def htmlIsBooleanAttr(name):
71 """Determine if a given attribute is a boolean attribute. """
72 ret = libxml2mod.htmlIsBooleanAttr(name)
73 return ret
74
75def htmlNewDoc(URI, ExternalID):
76 """Creates a new HTML document """
77 ret = libxml2mod.htmlNewDoc(URI, ExternalID)
78 if ret is None:raise treeError('htmlNewDoc() failed')
79 return xmlDoc(_obj=ret)
80
81def htmlNewDocNoDtD(URI, ExternalID):
82 """Creates a new HTML document without a DTD node if @URI and
83 @ExternalID are None """
84 ret = libxml2mod.htmlNewDocNoDtD(URI, ExternalID)
85 if ret is None:raise treeError('htmlNewDocNoDtD() failed')
86 return xmlDoc(_obj=ret)
87
88#
89# Functions from module SAX2
90#
91
92def SAXDefaultVersion(version):
93 """Set the default version of SAX used globally by the
94 library. By default, during initialization the default is
95 set to 2. Note that it is generally a better coding style
96 to use xmlSAXVersion() to set up the version explicitly for
97 a given parsing context. """
98 ret = libxml2mod.xmlSAXDefaultVersion(version)
99 return ret
100
101def defaultSAXHandlerInit():
102 """Initialize the default SAX2 handler """
103 libxml2mod.xmlDefaultSAXHandlerInit()
104
105def docbDefaultSAXHandlerInit():
106 """Initialize the default SAX handler """
107 libxml2mod.docbDefaultSAXHandlerInit()
108
109def htmlDefaultSAXHandlerInit():
110 """Initialize the default SAX handler """
111 libxml2mod.htmlDefaultSAXHandlerInit()
112
113#
114# Functions from module catalog
115#
116
117def catalogAdd(type, orig, replace):
118 """Add an entry in the catalog, it may overwrite existing but
119 different entries. If called before any other catalog
120 routine, allows to override the default shared catalog put
121 in place by xmlInitializeCatalog(); """
122 ret = libxml2mod.xmlCatalogAdd(type, orig, replace)
123 return ret
124
125def catalogCleanup():
126 """Free up all the memory associated with catalogs """
127 libxml2mod.xmlCatalogCleanup()
128
129def catalogConvert():
130 """Convert all the SGML catalog entries as XML ones """
131 ret = libxml2mod.xmlCatalogConvert()
132 return ret
133
134def catalogDump(out):
135 """Dump all the global catalog content to the given file. """
136 if out is not None: out.flush()
137 libxml2mod.xmlCatalogDump(out)
138
139def catalogGetPublic(pubID):
140 """Try to lookup the catalog reference associated to a public
141 ID DEPRECATED, use xmlCatalogResolvePublic() """
142 ret = libxml2mod.xmlCatalogGetPublic(pubID)
143 return ret
144
145def catalogGetSystem(sysID):
146 """Try to lookup the catalog reference associated to a system
147 ID DEPRECATED, use xmlCatalogResolveSystem() """
148 ret = libxml2mod.xmlCatalogGetSystem(sysID)
149 return ret
150
151def catalogRemove(value):
152 """Remove an entry from the catalog """
153 ret = libxml2mod.xmlCatalogRemove(value)
154 return ret
155
156def catalogResolve(pubID, sysID):
157 """Do a complete resolution lookup of an External Identifier """
158 ret = libxml2mod.xmlCatalogResolve(pubID, sysID)
159 return ret
160
161def catalogResolvePublic(pubID):
162 """Try to lookup the catalog reference associated to a public
163 ID """
164 ret = libxml2mod.xmlCatalogResolvePublic(pubID)
165 return ret
166
167def catalogResolveSystem(sysID):
168 """Try to lookup the catalog resource for a system ID """
169 ret = libxml2mod.xmlCatalogResolveSystem(sysID)
170 return ret
171
172def catalogResolveURI(URI):
173 """Do a complete resolution lookup of an URI """
174 ret = libxml2mod.xmlCatalogResolveURI(URI)
175 return ret
176
177def catalogSetDebug(level):
178 """Used to set the debug level for catalog operation, 0
179 disable debugging, 1 enable it """
180 ret = libxml2mod.xmlCatalogSetDebug(level)
181 return ret
182
183def initializeCatalog():
184 """Do the catalog initialization. this function is not thread
185 safe, catalog initialization should preferably be done once
186 at startup """
187 libxml2mod.xmlInitializeCatalog()
188
189def loadACatalog(filename):
190 """Load the catalog and build the associated data structures.
191 This can be either an XML Catalog or an SGML Catalog It
192 will recurse in SGML CATALOG entries. On the other hand XML
193 Catalogs are not handled recursively. """
194 ret = libxml2mod.xmlLoadACatalog(filename)
195 if ret is None:raise treeError('xmlLoadACatalog() failed')
196 return catalog(_obj=ret)
197
198def loadCatalog(filename):
199 """Load the catalog and makes its definitions effective for
200 the default external entity loader. It will recurse in SGML
201 CATALOG entries. this function is not thread safe, catalog
202 initialization should preferably be done once at startup """
203 ret = libxml2mod.xmlLoadCatalog(filename)
204 return ret
205
206def loadCatalogs(pathss):
207 """Load the catalogs and makes their definitions effective for
208 the default external entity loader. this function is not
209 thread safe, catalog initialization should preferably be
210 done once at startup """
211 libxml2mod.xmlLoadCatalogs(pathss)
212
213def loadSGMLSuperCatalog(filename):
214 """Load an SGML super catalog. It won't expand CATALOG or
215 DELEGATE references. This is only needed for manipulating
216 SGML Super Catalogs like adding and removing CATALOG or
217 DELEGATE entries. """
218 ret = libxml2mod.xmlLoadSGMLSuperCatalog(filename)
219 if ret is None:raise treeError('xmlLoadSGMLSuperCatalog() failed')
220 return catalog(_obj=ret)
221
222def newCatalog(sgml):
223 """create a new Catalog. """
224 ret = libxml2mod.xmlNewCatalog(sgml)
225 if ret is None:raise treeError('xmlNewCatalog() failed')
226 return catalog(_obj=ret)
227
228def parseCatalogFile(filename):
229 """parse an XML file and build a tree. It's like
230 xmlParseFile() except it bypass all catalog lookups. """
231 ret = libxml2mod.xmlParseCatalogFile(filename)
232 if ret is None:raise parserError('xmlParseCatalogFile() failed')
233 return xmlDoc(_obj=ret)
234
235#
236# Functions from module chvalid
237#
238
239def isBaseChar(ch):
240 """This function is DEPRECATED. Use xmlIsBaseChar_ch or
241 xmlIsBaseCharQ instead """
242 ret = libxml2mod.xmlIsBaseChar(ch)
243 return ret
244
245def isBlank(ch):
246 """This function is DEPRECATED. Use xmlIsBlank_ch or
247 xmlIsBlankQ instead """
248 ret = libxml2mod.xmlIsBlank(ch)
249 return ret
250
251def isChar(ch):
252 """This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ
253 instead """
254 ret = libxml2mod.xmlIsChar(ch)
255 return ret
256
257def isCombining(ch):
258 """This function is DEPRECATED. Use xmlIsCombiningQ instead """
259 ret = libxml2mod.xmlIsCombining(ch)
260 return ret
261
262def isDigit(ch):
263 """This function is DEPRECATED. Use xmlIsDigit_ch or
264 xmlIsDigitQ instead """
265 ret = libxml2mod.xmlIsDigit(ch)
266 return ret
267
268def isExtender(ch):
269 """This function is DEPRECATED. Use xmlIsExtender_ch or
270 xmlIsExtenderQ instead """
271 ret = libxml2mod.xmlIsExtender(ch)
272 return ret
273
274def isIdeographic(ch):
275 """This function is DEPRECATED. Use xmlIsIdeographicQ instead """
276 ret = libxml2mod.xmlIsIdeographic(ch)
277 return ret
278
279def isPubidChar(ch):
280 """This function is DEPRECATED. Use xmlIsPubidChar_ch or
281 xmlIsPubidCharQ instead """
282 ret = libxml2mod.xmlIsPubidChar(ch)
283 return ret
284
285#
286# Functions from module debugXML
287#
288
289def boolToText(boolval):
290 """Convenient way to turn bool into text """
291 ret = libxml2mod.xmlBoolToText(boolval)
292 return ret
293
294def debugDumpString(output, str):
295 """Dumps informations about the string, shorten it if necessary """
296 if output is not None: output.flush()
297 libxml2mod.xmlDebugDumpString(output, str)
298
299def shellPrintXPathError(errorType, arg):
300 """Print the xpath error to libxml default error channel """
301 libxml2mod.xmlShellPrintXPathError(errorType, arg)
302
303#
304# Functions from module dict
305#
306
307def dictCleanup():
308 """Free the dictionary mutex. Do not call unless sure the
309 library is not in use anymore ! """
310 libxml2mod.xmlDictCleanup()
311
312def initializeDict():
313 """Do the dictionary mutex initialization. this function is
314 deprecated """
315 ret = libxml2mod.xmlInitializeDict()
316 return ret
317
318#
319# Functions from module encoding
320#
321
322def addEncodingAlias(name, alias):
323 """Registers an alias @alias for an encoding named @name.
324 Existing alias will be overwritten. """
325 ret = libxml2mod.xmlAddEncodingAlias(name, alias)
326 return ret
327
328def cleanupCharEncodingHandlers():
329 """Cleanup the memory allocated for the char encoding support,
330 it unregisters all the encoding handlers and the aliases. """
331 libxml2mod.xmlCleanupCharEncodingHandlers()
332
333def cleanupEncodingAliases():
334 """Unregisters all aliases """
335 libxml2mod.xmlCleanupEncodingAliases()
336
337def delEncodingAlias(alias):
338 """Unregisters an encoding alias @alias """
339 ret = libxml2mod.xmlDelEncodingAlias(alias)
340 return ret
341
342def encodingAlias(alias):
343 """Lookup an encoding name for the given alias. """
344 ret = libxml2mod.xmlGetEncodingAlias(alias)
345 return ret
346
347def initCharEncodingHandlers():
348 """Initialize the char encoding support, it registers the
349 default encoding supported. NOTE: while public, this
350 function usually doesn't need to be called in normal
351 processing. """
352 libxml2mod.xmlInitCharEncodingHandlers()
353
354#
355# Functions from module entities
356#
357
358def cleanupPredefinedEntities():
359 """Cleanup up the predefined entities table. Deprecated call """
360 libxml2mod.xmlCleanupPredefinedEntities()
361
362def initializePredefinedEntities():
363 """Set up the predefined entities. Deprecated call """
364 libxml2mod.xmlInitializePredefinedEntities()
365
366def predefinedEntity(name):
367 """Check whether this name is an predefined entity. """
368 ret = libxml2mod.xmlGetPredefinedEntity(name)
369 if ret is None:raise treeError('xmlGetPredefinedEntity() failed')
370 return xmlEntity(_obj=ret)
371
372#
373# Functions from module globals
374#
375
376def cleanupGlobals():
377 """Additional cleanup for multi-threading """
378 libxml2mod.xmlCleanupGlobals()
379
380def initGlobals():
381 """Additional initialisation for multi-threading """
382 libxml2mod.xmlInitGlobals()
383
384def thrDefDefaultBufferSize(v):
385 ret = libxml2mod.xmlThrDefDefaultBufferSize(v)
386 return ret
387
388def thrDefDoValidityCheckingDefaultValue(v):
389 ret = libxml2mod.xmlThrDefDoValidityCheckingDefaultValue(v)
390 return ret
391
392def thrDefGetWarningsDefaultValue(v):
393 ret = libxml2mod.xmlThrDefGetWarningsDefaultValue(v)
394 return ret
395
396def thrDefIndentTreeOutput(v):
397 ret = libxml2mod.xmlThrDefIndentTreeOutput(v)
398 return ret
399
400def thrDefKeepBlanksDefaultValue(v):
401 ret = libxml2mod.xmlThrDefKeepBlanksDefaultValue(v)
402 return ret
403
404def thrDefLineNumbersDefaultValue(v):
405 ret = libxml2mod.xmlThrDefLineNumbersDefaultValue(v)
406 return ret
407
408def thrDefLoadExtDtdDefaultValue(v):
409 ret = libxml2mod.xmlThrDefLoadExtDtdDefaultValue(v)
410 return ret
411
412def thrDefParserDebugEntities(v):
413 ret = libxml2mod.xmlThrDefParserDebugEntities(v)
414 return ret
415
416def thrDefPedanticParserDefaultValue(v):
417 ret = libxml2mod.xmlThrDefPedanticParserDefaultValue(v)
418 return ret
419
420def thrDefSaveNoEmptyTags(v):
421 ret = libxml2mod.xmlThrDefSaveNoEmptyTags(v)
422 return ret
423
424def thrDefSubstituteEntitiesDefaultValue(v):
425 ret = libxml2mod.xmlThrDefSubstituteEntitiesDefaultValue(v)
426 return ret
427
428def thrDefTreeIndentString(v):
429 ret = libxml2mod.xmlThrDefTreeIndentString(v)
430 return ret
431
432#
433# Functions from module nanoftp
434#
435
436def nanoFTPCleanup():
437 """Cleanup the FTP protocol layer. This cleanup proxy
438 informations. """
439 libxml2mod.xmlNanoFTPCleanup()
440
441def nanoFTPInit():
442 """Initialize the FTP protocol layer. Currently it just checks
443 for proxy informations, and get the hostname """
444 libxml2mod.xmlNanoFTPInit()
445
446def nanoFTPProxy(host, port, user, passwd, type):
447 """Setup the FTP proxy informations. This can also be done by
448 using ftp_proxy ftp_proxy_user and ftp_proxy_password
449 environment variables. """
450 libxml2mod.xmlNanoFTPProxy(host, port, user, passwd, type)
451
452def nanoFTPScanProxy(URL):
453 """(Re)Initialize the FTP Proxy context by parsing the URL and
454 finding the protocol host port it indicates. Should be like
455 ftp://myproxy/ or ftp://myproxy:3128/ A None URL cleans up
456 proxy informations. """
457 libxml2mod.xmlNanoFTPScanProxy(URL)
458
459#
460# Functions from module nanohttp
461#
462
463def nanoHTTPCleanup():
464 """Cleanup the HTTP protocol layer. """
465 libxml2mod.xmlNanoHTTPCleanup()
466
467def nanoHTTPInit():
468 """Initialize the HTTP protocol layer. Currently it just
469 checks for proxy informations """
470 libxml2mod.xmlNanoHTTPInit()
471
472def nanoHTTPScanProxy(URL):
473 """(Re)Initialize the HTTP Proxy context by parsing the URL
474 and finding the protocol host port it indicates. Should be
475 like http://myproxy/ or http://myproxy:3128/ A None URL
476 cleans up proxy informations. """
477 libxml2mod.xmlNanoHTTPScanProxy(URL)
478
479#
480# Functions from module parser
481#
482
483def createDocParserCtxt(cur):
484 """Creates a parser context for an XML in-memory document. """
485 ret = libxml2mod.xmlCreateDocParserCtxt(cur)
486 if ret is None:raise parserError('xmlCreateDocParserCtxt() failed')
487 return parserCtxt(_obj=ret)
488
489def initParser():
490 """Initialization function for the XML parser. This is not
491 reentrant. Call once before processing in case of use in
492 multithreaded programs. """
493 libxml2mod.xmlInitParser()
494
495def keepBlanksDefault(val):
496 """Set and return the previous value for default blanks text
497 nodes support. The 1.x version of the parser used an
498 heuristic to try to detect ignorable white spaces. As a
499 result the SAX callback was generating
500 xmlSAX2IgnorableWhitespace() callbacks instead of
501 characters() one, and when using the DOM output text nodes
502 containing those blanks were not generated. The 2.x and
503 later version will switch to the XML standard way and
504 ignorableWhitespace() are only generated when running the
505 parser in validating mode and when the current element
506 doesn't allow CDATA or mixed content. This function is
507 provided as a way to force the standard behavior on 1.X
508 libs and to switch back to the old mode for compatibility
509 when running 1.X client code on 2.X . Upgrade of 1.X code
510 should be done by using xmlIsBlankNode() commodity function
511 to detect the "empty" nodes generated. This value also
512 affect autogeneration of indentation when saving code if
513 blanks sections are kept, indentation is not generated. """
514 ret = libxml2mod.xmlKeepBlanksDefault(val)
515 return ret
516
517def lineNumbersDefault(val):
518 """Set and return the previous value for enabling line numbers
519 in elements contents. This may break on old application and
520 is turned off by default. """
521 ret = libxml2mod.xmlLineNumbersDefault(val)
522 return ret
523
524def newParserCtxt():
525 """Allocate and initialize a new parser context. """
526 ret = libxml2mod.xmlNewParserCtxt()
527 if ret is None:raise parserError('xmlNewParserCtxt() failed')
528 return parserCtxt(_obj=ret)
529
530def parseDTD(ExternalID, SystemID):
531 """Load and parse an external subset. """
532 ret = libxml2mod.xmlParseDTD(ExternalID, SystemID)
533 if ret is None:raise parserError('xmlParseDTD() failed')
534 return xmlDtd(_obj=ret)
535
536def parseDoc(cur):
537 """parse an XML in-memory document and build a tree. """
538 ret = libxml2mod.xmlParseDoc(cur)
539 if ret is None:raise parserError('xmlParseDoc() failed')
540 return xmlDoc(_obj=ret)
541
542def parseEntity(filename):
543 """parse an XML external entity out of context and build a
544 tree. [78] extParsedEnt ::= TextDecl? content This
545 correspond to a "Well Balanced" chunk """
546 ret = libxml2mod.xmlParseEntity(filename)
547 if ret is None:raise parserError('xmlParseEntity() failed')
548 return xmlDoc(_obj=ret)
549
550def parseFile(filename):
551 """parse an XML file and build a tree. Automatic support for
552 ZLIB/Compress compressed document is provided by default if
553 found at compile-time. """
554 ret = libxml2mod.xmlParseFile(filename)
555 if ret is None:raise parserError('xmlParseFile() failed')
556 return xmlDoc(_obj=ret)
557
558def parseMemory(buffer, size):
559 """parse an XML in-memory block and build a tree. """
560 ret = libxml2mod.xmlParseMemory(buffer, size)
561 if ret is None:raise parserError('xmlParseMemory() failed')
562 return xmlDoc(_obj=ret)
563
564def pedanticParserDefault(val):
565 """Set and return the previous value for enabling pedantic
566 warnings. """
567 ret = libxml2mod.xmlPedanticParserDefault(val)
568 return ret
569
570def readDoc(cur, URL, encoding, options):
571 """parse an XML in-memory document and build a tree. """
572 ret = libxml2mod.xmlReadDoc(cur, URL, encoding, options)
573 if ret is None:raise treeError('xmlReadDoc() failed')
574 return xmlDoc(_obj=ret)
575
576def readFd(fd, URL, encoding, options):
577 """parse an XML from a file descriptor and build a tree. NOTE
578 that the file descriptor will not be closed when the reader
579 is closed or reset. """
580 ret = libxml2mod.xmlReadFd(fd, URL, encoding, options)
581 if ret is None:raise treeError('xmlReadFd() failed')
582 return xmlDoc(_obj=ret)
583
584def readFile(filename, encoding, options):
585 """parse an XML file from the filesystem or the network. """
586 ret = libxml2mod.xmlReadFile(filename, encoding, options)
587 if ret is None:raise treeError('xmlReadFile() failed')
588 return xmlDoc(_obj=ret)
589
590def readMemory(buffer, size, URL, encoding, options):
591 """parse an XML in-memory document and build a tree. """
592 ret = libxml2mod.xmlReadMemory(buffer, size, URL, encoding, options)
593 if ret is None:raise treeError('xmlReadMemory() failed')
594 return xmlDoc(_obj=ret)
595
596def recoverDoc(cur):
597 """parse an XML in-memory document and build a tree. In the
598 case the document is not Well Formed, a attempt to build a
599 tree is tried anyway """
600 ret = libxml2mod.xmlRecoverDoc(cur)
601 if ret is None:raise treeError('xmlRecoverDoc() failed')
602 return xmlDoc(_obj=ret)
603
604def recoverFile(filename):
605 """parse an XML file and build a tree. Automatic support for
606 ZLIB/Compress compressed document is provided by default if
607 found at compile-time. In the case the document is not Well
608 Formed, it attempts to build a tree anyway """
609 ret = libxml2mod.xmlRecoverFile(filename)
610 if ret is None:raise treeError('xmlRecoverFile() failed')
611 return xmlDoc(_obj=ret)
612
613def recoverMemory(buffer, size):
614 """parse an XML in-memory block and build a tree. In the case
615 the document is not Well Formed, an attempt to build a tree
616 is tried anyway """
617 ret = libxml2mod.xmlRecoverMemory(buffer, size)
618 if ret is None:raise treeError('xmlRecoverMemory() failed')
619 return xmlDoc(_obj=ret)
620
621def substituteEntitiesDefault(val):
622 """Set and return the previous value for default entity
623 support. Initially the parser always keep entity references
624 instead of substituting entity values in the output. This
625 function has to be used to change the default parser
626 behavior SAX::substituteEntities() has to be used for
627 changing that on a file by file basis. """
628 ret = libxml2mod.xmlSubstituteEntitiesDefault(val)
629 return ret
630
631#
632# Functions from module parserInternals
633#
634
635def checkLanguageID(lang):
636 """Checks that the value conforms to the LanguageID
637 production: NOTE: this is somewhat deprecated, those
638 productions were removed from the XML Second edition. [33]
639 LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::=
640 ISO639Code | IanaCode | UserCode [35] ISO639Code ::=
641 ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' |
642 'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-'
643 ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+ The
644 current REC reference the sucessors of RFC 1766, currently
645 5646 http://www.rfc-editor.org/rfc/rfc5646.txt langtag
646 = language ["-" script] ["-" region] *("-" variant) *("-"
647 extension) ["-" privateuse] language = 2*3ALPHA
648 ; shortest ISO 639 code ["-" extlang] ; sometimes
649 followed by ; extended language subtags / 4ALPHA
650 ; or reserved for future use / 5*8ALPHA ; or
651 registered language subtag extlang = 3ALPHA
652 ; selected ISO 639 codes *2("-" 3ALPHA) ; permanently
653 reserved script = 4ALPHA ; ISO 15924
654 code region = 2ALPHA ; ISO 3166-1 code
655 / 3DIGIT ; UN M.49 code variant =
656 5*8alphanum ; registered variants / (DIGIT
657 3alphanum) extension = singleton 1*("-" (2*8alphanum))
658 ; Single alphanumerics ; "x" reserved for private use
659 singleton = DIGIT ; 0 - 9 / %x41-57
660 ; A - W / %x59-5A ; Y - Z / %x61-77
661 ; a - w / %x79-7A ; y - z it sounds right to
662 still allow Irregular i-xxx IANA and user codes too The
663 parser below doesn't try to cope with extension or
664 privateuse that could be added but that's not interoperable
665 anyway """
666 ret = libxml2mod.xmlCheckLanguageID(lang)
667 return ret
668
669def copyChar(len, out, val):
670 """append the char value in the array """
671 ret = libxml2mod.xmlCopyChar(len, out, val)
672 return ret
673
674def copyCharMultiByte(out, val):
675 """append the char value in the array """
676 ret = libxml2mod.xmlCopyCharMultiByte(out, val)
677 return ret
678
679def createEntityParserCtxt(URL, ID, base):
680 """Create a parser context for an external entity Automatic
681 support for ZLIB/Compress compressed document is provided
682 by default if found at compile-time. """
683 ret = libxml2mod.xmlCreateEntityParserCtxt(URL, ID, base)
684 if ret is None:raise parserError('xmlCreateEntityParserCtxt() failed')
685 return parserCtxt(_obj=ret)
686
687def createFileParserCtxt(filename):
688 """Create a parser context for a file content. Automatic
689 support for ZLIB/Compress compressed document is provided
690 by default if found at compile-time. """
691 ret = libxml2mod.xmlCreateFileParserCtxt(filename)
692 if ret is None:raise parserError('xmlCreateFileParserCtxt() failed')
693 return parserCtxt(_obj=ret)
694
695def createMemoryParserCtxt(buffer, size):
696 """Create a parser context for an XML in-memory document. """
697 ret = libxml2mod.xmlCreateMemoryParserCtxt(buffer, size)
698 if ret is None:raise parserError('xmlCreateMemoryParserCtxt() failed')
699 return parserCtxt(_obj=ret)
700
701def createURLParserCtxt(filename, options):
702 """Create a parser context for a file or URL content.
703 Automatic support for ZLIB/Compress compressed document is
704 provided by default if found at compile-time and for file
705 accesses """
706 ret = libxml2mod.xmlCreateURLParserCtxt(filename, options)
707 if ret is None:raise parserError('xmlCreateURLParserCtxt() failed')
708 return parserCtxt(_obj=ret)
709
710def htmlCreateFileParserCtxt(filename, encoding):
711 """Create a parser context for a file content. Automatic
712 support for ZLIB/Compress compressed document is provided
713 by default if found at compile-time. """
714 ret = libxml2mod.htmlCreateFileParserCtxt(filename, encoding)
715 if ret is None:raise parserError('htmlCreateFileParserCtxt() failed')
716 return parserCtxt(_obj=ret)
717
718def htmlInitAutoClose():
719 """Initialize the htmlStartCloseIndex for fast lookup of
720 closing tags names. This is not reentrant. Call
721 xmlInitParser() once before processing in case of use in
722 multithreaded programs. """
723 libxml2mod.htmlInitAutoClose()
724
725def isLetter(c):
726 """Check whether the character is allowed by the production
727 [84] Letter ::= BaseChar | Ideographic """
728 ret = libxml2mod.xmlIsLetter(c)
729 return ret
730
731def namePop(ctxt):
732 """Pops the top element name from the name stack """
733 if ctxt is None: ctxt__o = None
734 else: ctxt__o = ctxt._o
735 ret = libxml2mod.namePop(ctxt__o)
736 return ret
737
738def namePush(ctxt, value):
739 """Pushes a new element name on top of the name stack """
740 if ctxt is None: ctxt__o = None
741 else: ctxt__o = ctxt._o
742 ret = libxml2mod.namePush(ctxt__o, value)
743 return ret
744
745def nodePop(ctxt):
746 """Pops the top element node from the node stack """
747 if ctxt is None: ctxt__o = None
748 else: ctxt__o = ctxt._o
749 ret = libxml2mod.nodePop(ctxt__o)
750 if ret is None:raise treeError('nodePop() failed')
751 return xmlNode(_obj=ret)
752
753def nodePush(ctxt, value):
754 """Pushes a new element node on top of the node stack """
755 if ctxt is None: ctxt__o = None
756 else: ctxt__o = ctxt._o
757 if value is None: value__o = None
758 else: value__o = value._o
759 ret = libxml2mod.nodePush(ctxt__o, value__o)
760 return ret
761
762#
763# Functions from module python
764#
765
766def SAXParseFile(SAX, URI, recover):
767 """Interface to parse an XML file or resource pointed by an
768 URI to build an event flow to the SAX object """
769 libxml2mod.xmlSAXParseFile(SAX, URI, recover)
770
771def createInputBuffer(file, encoding):
772 """Create a libxml2 input buffer from a Python file """
773 ret = libxml2mod.xmlCreateInputBuffer(file, encoding)
774 if ret is None:raise treeError('xmlCreateInputBuffer() failed')
775 return inputBuffer(_obj=ret)
776
777def createOutputBuffer(file, encoding):
778 """Create a libxml2 output buffer from a Python file """
779 ret = libxml2mod.xmlCreateOutputBuffer(file, encoding)
780 if ret is None:raise treeError('xmlCreateOutputBuffer() failed')
781 return outputBuffer(_obj=ret)
782
783def createPushParser(SAX, chunk, size, URI):
784 """Create a progressive XML parser context to build either an
785 event flow if the SAX object is not None, or a DOM tree
786 otherwise. """
787 ret = libxml2mod.xmlCreatePushParser(SAX, chunk, size, URI)
788 if ret is None:raise parserError('xmlCreatePushParser() failed')
789 return parserCtxt(_obj=ret)
790
791def debugMemory(activate):
792 """Switch on the generation of line number for elements nodes.
793 Also returns the number of bytes allocated and not freed by
794 libxml2 since memory debugging was switched on. """
795 ret = libxml2mod.xmlDebugMemory(activate)
796 return ret
797
798def dumpMemory():
799 """dump the memory allocated in the file .memdump """
800 libxml2mod.xmlDumpMemory()
801
802def htmlCreatePushParser(SAX, chunk, size, URI):
803 """Create a progressive HTML parser context to build either an
804 event flow if the SAX object is not None, or a DOM tree
805 otherwise. """
806 ret = libxml2mod.htmlCreatePushParser(SAX, chunk, size, URI)
807 if ret is None:raise parserError('htmlCreatePushParser() failed')
808 return parserCtxt(_obj=ret)
809
810def htmlSAXParseFile(SAX, URI, encoding):
811 """Interface to parse an HTML file or resource pointed by an
812 URI to build an event flow to the SAX object """
813 libxml2mod.htmlSAXParseFile(SAX, URI, encoding)
814
815def memoryUsed():
816 """Returns the total amount of memory allocated by libxml2 """
817 ret = libxml2mod.xmlMemoryUsed()
818 return ret
819
820def newNode(name):
821 """Create a new Node """
822 ret = libxml2mod.xmlNewNode(name)
823 if ret is None:raise treeError('xmlNewNode() failed')
824 return xmlNode(_obj=ret)
825
826def pythonCleanupParser():
827 """Cleanup function for the XML library. It tries to reclaim
828 all parsing related global memory allocated for the library
829 processing. It doesn't deallocate any document related
830 memory. Calling this function should not prevent reusing
831 the library but one should call xmlCleanupParser() only
832 when the process has finished using the library or XML
833 document built with it. """
834 libxml2mod.xmlPythonCleanupParser()
835
836def setEntityLoader(resolver):
837 """Set the entity resolver as a python function """
838 ret = libxml2mod.xmlSetEntityLoader(resolver)
839 return ret
840
841#
842# Functions from module relaxng
843#
844
845def relaxNGCleanupTypes():
846 """Cleanup the default Schemas type library associated to
847 RelaxNG """
848 libxml2mod.xmlRelaxNGCleanupTypes()
849
850def relaxNGInitTypes():
851 """Initilize the default type libraries. """
852 ret = libxml2mod.xmlRelaxNGInitTypes()
853 return ret
854
855def relaxNGNewMemParserCtxt(buffer, size):
856 """Create an XML RelaxNGs parse context for that memory buffer
857 expected to contain an XML RelaxNGs file. """
858 ret = libxml2mod.xmlRelaxNGNewMemParserCtxt(buffer, size)
859 if ret is None:raise parserError('xmlRelaxNGNewMemParserCtxt() failed')
860 return relaxNgParserCtxt(_obj=ret)
861
862def relaxNGNewParserCtxt(URL):
863 """Create an XML RelaxNGs parse context for that file/resource
864 expected to contain an XML RelaxNGs file. """
865 ret = libxml2mod.xmlRelaxNGNewParserCtxt(URL)
866 if ret is None:raise parserError('xmlRelaxNGNewParserCtxt() failed')
867 return relaxNgParserCtxt(_obj=ret)
868
869#
870# Functions from module tree
871#
872
873def buildQName(ncname, prefix, memory, len):
874 """Builds the QName @prefix:@ncname in @memory if there is
875 enough space and prefix is not None nor empty, otherwise
876 allocate a new string. If prefix is None or empty it
877 returns ncname. """
878 ret = libxml2mod.xmlBuildQName(ncname, prefix, memory, len)
879 return ret
880
881def compressMode():
882 """get the default compression mode used, ZLIB based. """
883 ret = libxml2mod.xmlGetCompressMode()
884 return ret
885
886def isXHTML(systemID, publicID):
887 """Try to find if the document correspond to an XHTML DTD """
888 ret = libxml2mod.xmlIsXHTML(systemID, publicID)
889 return ret
890
891def newComment(content):
892 """Creation of a new node containing a comment. """
893 ret = libxml2mod.xmlNewComment(content)
894 if ret is None:raise treeError('xmlNewComment() failed')
895 return xmlNode(_obj=ret)
896
897def newDoc(version):
898 """Creates a new XML document """
899 ret = libxml2mod.xmlNewDoc(version)
900 if ret is None:raise treeError('xmlNewDoc() failed')
901 return xmlDoc(_obj=ret)
902
903def newPI(name, content):
904 """Creation of a processing instruction element. Use
905 xmlDocNewPI preferably to get string interning """
906 ret = libxml2mod.xmlNewPI(name, content)
907 if ret is None:raise treeError('xmlNewPI() failed')
908 return xmlNode(_obj=ret)
909
910def newText(content):
911 """Creation of a new text node. """
912 ret = libxml2mod.xmlNewText(content)
913 if ret is None:raise treeError('xmlNewText() failed')
914 return xmlNode(_obj=ret)
915
916def newTextLen(content, len):
917 """Creation of a new text node with an extra parameter for the
918 content's length """
919 ret = libxml2mod.xmlNewTextLen(content, len)
920 if ret is None:raise treeError('xmlNewTextLen() failed')
921 return xmlNode(_obj=ret)
922
923def setCompressMode(mode):
924 """set the default compression mode used, ZLIB based Correct
925 values: 0 (uncompressed) to 9 (max compression) """
926 libxml2mod.xmlSetCompressMode(mode)
927
928def validateNCName(value, space):
929 """Check that a value conforms to the lexical space of NCName """
930 ret = libxml2mod.xmlValidateNCName(value, space)
931 return ret
932
933def validateNMToken(value, space):
934 """Check that a value conforms to the lexical space of NMToken """
935 ret = libxml2mod.xmlValidateNMToken(value, space)
936 return ret
937
938def validateName(value, space):
939 """Check that a value conforms to the lexical space of Name """
940 ret = libxml2mod.xmlValidateName(value, space)
941 return ret
942
943def validateQName(value, space):
944 """Check that a value conforms to the lexical space of QName """
945 ret = libxml2mod.xmlValidateQName(value, space)
946 return ret
947
948#
949# Functions from module uri
950#
951
952def URIEscape(str):
953 """Escaping routine, does not do validity checks ! It will try
954 to escape the chars needing this, but this is heuristic
955 based it's impossible to be sure. """
956 ret = libxml2mod.xmlURIEscape(str)
957 return ret
958
959def URIEscapeStr(str, list):
960 """This routine escapes a string to hex, ignoring reserved
961 characters (a-z) and the characters in the exception list. """
962 ret = libxml2mod.xmlURIEscapeStr(str, list)
963 return ret
964
965def URIUnescapeString(str, len, target):
966 """Unescaping routine, but does not check that the string is
967 an URI. The output is a direct unsigned char translation of
968 %XX values (no encoding) Note that the length of the result
969 can only be smaller or same size as the input string. """
970 ret = libxml2mod.xmlURIUnescapeString(str, len, target)
971 return ret
972
973def buildRelativeURI(URI, base):
974 """Expresses the URI of the reference in terms relative to the
975 base. Some examples of this operation include: base =
976 "http://site1.com/docs/book1.html" URI input
977 URI returned docs/pic1.gif pic1.gif
978 docs/img/pic1.gif img/pic1.gif img/pic1.gif
979 ../img/pic1.gif http://site1.com/docs/pic1.gif pic1.gif
980 http://site2.com/docs/pic1.gif
981 http://site2.com/docs/pic1.gif base = "docs/book1.html"
982 URI input URI returned docs/pic1.gif
983 pic1.gif docs/img/pic1.gif img/pic1.gif
984 img/pic1.gif ../img/pic1.gif
985 http://site1.com/docs/pic1.gif
986 http://site1.com/docs/pic1.gif Note: if the URI reference
987 is really wierd or complicated, it may be worthwhile to
988 first convert it into a "nice" one by calling xmlBuildURI
989 (using 'base') before calling this routine, since this
990 routine (for reasonable efficiency) assumes URI has already
991 been through some validation. """
992 ret = libxml2mod.xmlBuildRelativeURI(URI, base)
993 return ret
994
995def buildURI(URI, base):
996 """Computes he final URI of the reference done by checking
997 that the given URI is valid, and building the final URI
998 using the base URI. This is processed according to section
999 5.2 of the RFC 2396 5.2. Resolving Relative References to
1000 Absolute Form """
1001 ret = libxml2mod.xmlBuildURI(URI, base)
1002 return ret
1003
1004def canonicPath(path):
1005 """Constructs a canonic path from the specified path. """
1006 ret = libxml2mod.xmlCanonicPath(path)
1007 return ret
1008
1009def createURI():
1010 """Simply creates an empty xmlURI """
1011 ret = libxml2mod.xmlCreateURI()
1012 if ret is None:raise uriError('xmlCreateURI() failed')
1013 return URI(_obj=ret)
1014
1015def normalizeURIPath(path):
1016 """Applies the 5 normalization steps to a path string--that
1017 is, RFC 2396 Section 5.2, steps 6.c through 6.g.
1018 Normalization occurs directly on the string, no new
1019 allocation is done """
1020 ret = libxml2mod.xmlNormalizeURIPath(path)
1021 return ret
1022
1023def parseURI(str):
1024 """Parse an URI based on RFC 3986 URI-reference = [
1025 absoluteURI | relativeURI ] [ "#" fragment ] """
1026 ret = libxml2mod.xmlParseURI(str)
1027 if ret is None:raise uriError('xmlParseURI() failed')
1028 return URI(_obj=ret)
1029
1030def parseURIRaw(str, raw):
1031 """Parse an URI but allows to keep intact the original
1032 fragments. URI-reference = URI / relative-ref """
1033 ret = libxml2mod.xmlParseURIRaw(str, raw)
1034 if ret is None:raise uriError('xmlParseURIRaw() failed')
1035 return URI(_obj=ret)
1036
1037def pathToURI(path):
1038 """Constructs an URI expressing the existing path """
1039 ret = libxml2mod.xmlPathToURI(path)
1040 return ret
1041
1042#
1043# Functions from module valid
1044#
1045
1046def newValidCtxt():
1047 """Allocate a validation context structure. """
1048 ret = libxml2mod.xmlNewValidCtxt()
1049 if ret is None:raise treeError('xmlNewValidCtxt() failed')
1050 return ValidCtxt(_obj=ret)
1051
1052def validateNameValue(value):
1053 """Validate that the given value match Name production """
1054 ret = libxml2mod.xmlValidateNameValue(value)
1055 return ret
1056
1057def validateNamesValue(value):
1058 """Validate that the given value match Names production """
1059 ret = libxml2mod.xmlValidateNamesValue(value)
1060 return ret
1061
1062def validateNmtokenValue(value):
1063 """Validate that the given value match Nmtoken production [
1064 VC: Name Token ] """
1065 ret = libxml2mod.xmlValidateNmtokenValue(value)
1066 return ret
1067
1068def validateNmtokensValue(value):
1069 """Validate that the given value match Nmtokens production [
1070 VC: Name Token ] """
1071 ret = libxml2mod.xmlValidateNmtokensValue(value)
1072 return ret
1073
1074#
1075# Functions from module xmlIO
1076#
1077
1078def checkFilename(path):
1079 """function checks to see if @path is a valid source (file,
1080 socket...) for XML. if stat is not available on the target
1081 machine, """
1082 ret = libxml2mod.xmlCheckFilename(path)
1083 return ret
1084
1085def cleanupInputCallbacks():
1086 """clears the entire input callback table. this includes the
1087 compiled-in I/O. """
1088 libxml2mod.xmlCleanupInputCallbacks()
1089
1090def cleanupOutputCallbacks():
1091 """clears the entire output callback table. this includes the
1092 compiled-in I/O callbacks. """
1093 libxml2mod.xmlCleanupOutputCallbacks()
1094
1095def fileMatch(filename):
1096 """input from FILE * """
1097 ret = libxml2mod.xmlFileMatch(filename)
1098 return ret
1099
1100def iOFTPMatch(filename):
1101 """check if the URI matches an FTP one """
1102 ret = libxml2mod.xmlIOFTPMatch(filename)
1103 return ret
1104
1105def iOHTTPMatch(filename):
1106 """check if the URI matches an HTTP one """
1107 ret = libxml2mod.xmlIOHTTPMatch(filename)
1108 return ret
1109
1110def normalizeWindowsPath(path):
1111 """This function is obsolete. Please see xmlURIFromPath in
1112 uri.c for a better solution. """
1113 ret = libxml2mod.xmlNormalizeWindowsPath(path)
1114 return ret
1115
1116def parserGetDirectory(filename):
1117 """lookup the directory for that file """
1118 ret = libxml2mod.xmlParserGetDirectory(filename)
1119 return ret
1120
1121def registerDefaultInputCallbacks():
1122 """Registers the default compiled-in I/O handlers. """
1123 libxml2mod.xmlRegisterDefaultInputCallbacks()
1124
1125def registerDefaultOutputCallbacks():
1126 """Registers the default compiled-in I/O handlers. """
1127 libxml2mod.xmlRegisterDefaultOutputCallbacks()
1128
1129def registerHTTPPostCallbacks():
1130 """By default, libxml submits HTTP output requests using the
1131 "PUT" method. Calling this method changes the HTTP output
1132 method to use the "POST" method instead. """
1133 libxml2mod.xmlRegisterHTTPPostCallbacks()
1134
1135#
1136# Functions from module xmlerror
1137#
1138
1139def lastError():
1140 """Get the last global error registered. This is per thread if
1141 compiled with thread support. """
1142 ret = libxml2mod.xmlGetLastError()
1143 if ret is None:raise treeError('xmlGetLastError() failed')
1144 return Error(_obj=ret)
1145
1146def resetLastError():
1147 """Cleanup the last global error registered. For parsing error
1148 this does not change the well-formedness result. """
1149 libxml2mod.xmlResetLastError()
1150
1151#
1152# Functions from module xmlreader
1153#
1154
1155def newTextReaderFilename(URI):
1156 """Create an xmlTextReader structure fed with the resource at
1157 @URI """
1158 ret = libxml2mod.xmlNewTextReaderFilename(URI)
1159 if ret is None:raise treeError('xmlNewTextReaderFilename() failed')
1160 return xmlTextReader(_obj=ret)
1161
1162def readerForDoc(cur, URL, encoding, options):
1163 """Create an xmltextReader for an XML in-memory document. The
1164 parsing flags @options are a combination of xmlParserOption. """
1165 ret = libxml2mod.xmlReaderForDoc(cur, URL, encoding, options)
1166 if ret is None:raise treeError('xmlReaderForDoc() failed')
1167 return xmlTextReader(_obj=ret)
1168
1169def readerForFd(fd, URL, encoding, options):
1170 """Create an xmltextReader for an XML from a file descriptor.
1171 The parsing flags @options are a combination of
1172 xmlParserOption. NOTE that the file descriptor will not be
1173 closed when the reader is closed or reset. """
1174 ret = libxml2mod.xmlReaderForFd(fd, URL, encoding, options)
1175 if ret is None:raise treeError('xmlReaderForFd() failed')
1176 return xmlTextReader(_obj=ret)
1177
1178def readerForFile(filename, encoding, options):
1179 """parse an XML file from the filesystem or the network. The
1180 parsing flags @options are a combination of xmlParserOption. """
1181 ret = libxml2mod.xmlReaderForFile(filename, encoding, options)
1182 if ret is None:raise treeError('xmlReaderForFile() failed')
1183 return xmlTextReader(_obj=ret)
1184
1185def readerForMemory(buffer, size, URL, encoding, options):
1186 """Create an xmltextReader for an XML in-memory document. The
1187 parsing flags @options are a combination of xmlParserOption. """
1188 ret = libxml2mod.xmlReaderForMemory(buffer, size, URL, encoding, options)
1189 if ret is None:raise treeError('xmlReaderForMemory() failed')
1190 return xmlTextReader(_obj=ret)
1191
1192#
1193# Functions from module xmlregexp
1194#
1195
1196def regexpCompile(regexp):
1197 """Parses a regular expression conforming to XML Schemas Part
1198 2 Datatype Appendix F and builds an automata suitable for
1199 testing strings against that regular expression """
1200 ret = libxml2mod.xmlRegexpCompile(regexp)
1201 if ret is None:raise treeError('xmlRegexpCompile() failed')
1202 return xmlReg(_obj=ret)
1203
1204#
1205# Functions from module xmlschemas
1206#
1207
1208def schemaNewMemParserCtxt(buffer, size):
1209 """Create an XML Schemas parse context for that memory buffer
1210 expected to contain an XML Schemas file. """
1211 ret = libxml2mod.xmlSchemaNewMemParserCtxt(buffer, size)
1212 if ret is None:raise parserError('xmlSchemaNewMemParserCtxt() failed')
1213 return SchemaParserCtxt(_obj=ret)
1214
1215def schemaNewParserCtxt(URL):
1216 """Create an XML Schemas parse context for that file/resource
1217 expected to contain an XML Schemas file. """
1218 ret = libxml2mod.xmlSchemaNewParserCtxt(URL)
1219 if ret is None:raise parserError('xmlSchemaNewParserCtxt() failed')
1220 return SchemaParserCtxt(_obj=ret)
1221
1222#
1223# Functions from module xmlschemastypes
1224#
1225
1226def schemaCleanupTypes():
1227 """Cleanup the default XML Schemas type library """
1228 libxml2mod.xmlSchemaCleanupTypes()
1229
1230def schemaCollapseString(value):
1231 """Removes and normalize white spaces in the string """
1232 ret = libxml2mod.xmlSchemaCollapseString(value)
1233 return ret
1234
1235def schemaInitTypes():
1236 """Initialize the default XML Schemas type library """
1237 libxml2mod.xmlSchemaInitTypes()
1238
1239def schemaWhiteSpaceReplace(value):
1240 """Replaces 0xd, 0x9 and 0xa with a space. """
1241 ret = libxml2mod.xmlSchemaWhiteSpaceReplace(value)
1242 return ret
1243
1244#
1245# Functions from module xmlstring
1246#
1247
1248def UTF8Charcmp(utf1, utf2):
1249 """compares the two UCS4 values """
1250 ret = libxml2mod.xmlUTF8Charcmp(utf1, utf2)
1251 return ret
1252
1253def UTF8Size(utf):
1254 """calculates the internal size of a UTF8 character """
1255 ret = libxml2mod.xmlUTF8Size(utf)
1256 return ret
1257
1258def UTF8Strlen(utf):
1259 """compute the length of an UTF8 string, it doesn't do a full
1260 UTF8 checking of the content of the string. """
1261 ret = libxml2mod.xmlUTF8Strlen(utf)
1262 return ret
1263
1264def UTF8Strloc(utf, utfchar):
1265 """a function to provide the relative location of a UTF8 char """
1266 ret = libxml2mod.xmlUTF8Strloc(utf, utfchar)
1267 return ret
1268
1269def UTF8Strndup(utf, len):
1270 """a strndup for array of UTF8's """
1271 ret = libxml2mod.xmlUTF8Strndup(utf, len)
1272 return ret
1273
1274def UTF8Strpos(utf, pos):
1275 """a function to provide the equivalent of fetching a
1276 character from a string array """
1277 ret = libxml2mod.xmlUTF8Strpos(utf, pos)
1278 return ret
1279
1280def UTF8Strsize(utf, len):
1281 """storage size of an UTF8 string the behaviour is not
1282 garanteed if the input string is not UTF-8 """
1283 ret = libxml2mod.xmlUTF8Strsize(utf, len)
1284 return ret
1285
1286def UTF8Strsub(utf, start, len):
1287 """Create a substring from a given UTF-8 string Note:
1288 positions are given in units of UTF-8 chars """
1289 ret = libxml2mod.xmlUTF8Strsub(utf, start, len)
1290 return ret
1291
1292def checkUTF8(utf):
1293 """Checks @utf for being valid UTF-8. @utf is assumed to be
1294 null-terminated. This function is not super-strict, as it
1295 will allow longer UTF-8 sequences than necessary. Note that
1296 Java is capable of producing these sequences if provoked.
1297 Also note, this routine checks for the 4-byte maximum size,
1298 but does not check for 0x10ffff maximum value. """
1299 ret = libxml2mod.xmlCheckUTF8(utf)
1300 return ret
1301
1302#
1303# Functions from module xmlunicode
1304#
1305
1306def uCSIsAegeanNumbers(code):
1307 """Check whether the character is part of AegeanNumbers UCS
1308 Block """
1309 ret = libxml2mod.xmlUCSIsAegeanNumbers(code)
1310 return ret
1311
1312def uCSIsAlphabeticPresentationForms(code):
1313 """Check whether the character is part of
1314 AlphabeticPresentationForms UCS Block """
1315 ret = libxml2mod.xmlUCSIsAlphabeticPresentationForms(code)
1316 return ret
1317
1318def uCSIsArabic(code):
1319 """Check whether the character is part of Arabic UCS Block """
1320 ret = libxml2mod.xmlUCSIsArabic(code)
1321 return ret
1322
1323def uCSIsArabicPresentationFormsA(code):
1324 """Check whether the character is part of
1325 ArabicPresentationForms-A UCS Block """
1326 ret = libxml2mod.xmlUCSIsArabicPresentationFormsA(code)
1327 return ret
1328
1329def uCSIsArabicPresentationFormsB(code):
1330 """Check whether the character is part of
1331 ArabicPresentationForms-B UCS Block """
1332 ret = libxml2mod.xmlUCSIsArabicPresentationFormsB(code)
1333 return ret
1334
1335def uCSIsArmenian(code):
1336 """Check whether the character is part of Armenian UCS Block """
1337 ret = libxml2mod.xmlUCSIsArmenian(code)
1338 return ret
1339
1340def uCSIsArrows(code):
1341 """Check whether the character is part of Arrows UCS Block """
1342 ret = libxml2mod.xmlUCSIsArrows(code)
1343 return ret
1344
1345def uCSIsBasicLatin(code):
1346 """Check whether the character is part of BasicLatin UCS Block """
1347 ret = libxml2mod.xmlUCSIsBasicLatin(code)
1348 return ret
1349
1350def uCSIsBengali(code):
1351 """Check whether the character is part of Bengali UCS Block """
1352 ret = libxml2mod.xmlUCSIsBengali(code)
1353 return ret
1354
1355def uCSIsBlock(code, block):
1356 """Check whether the character is part of the UCS Block """
1357 ret = libxml2mod.xmlUCSIsBlock(code, block)
1358 return ret
1359
1360def uCSIsBlockElements(code):
1361 """Check whether the character is part of BlockElements UCS
1362 Block """
1363 ret = libxml2mod.xmlUCSIsBlockElements(code)
1364 return ret
1365
1366def uCSIsBopomofo(code):
1367 """Check whether the character is part of Bopomofo UCS Block """
1368 ret = libxml2mod.xmlUCSIsBopomofo(code)
1369 return ret
1370
1371def uCSIsBopomofoExtended(code):
1372 """Check whether the character is part of BopomofoExtended UCS
1373 Block """
1374 ret = libxml2mod.xmlUCSIsBopomofoExtended(code)
1375 return ret
1376
1377def uCSIsBoxDrawing(code):
1378 """Check whether the character is part of BoxDrawing UCS Block """
1379 ret = libxml2mod.xmlUCSIsBoxDrawing(code)
1380 return ret
1381
1382def uCSIsBraillePatterns(code):
1383 """Check whether the character is part of BraillePatterns UCS
1384 Block """
1385 ret = libxml2mod.xmlUCSIsBraillePatterns(code)
1386 return ret
1387
1388def uCSIsBuhid(code):
1389 """Check whether the character is part of Buhid UCS Block """
1390 ret = libxml2mod.xmlUCSIsBuhid(code)
1391 return ret
1392
1393def uCSIsByzantineMusicalSymbols(code):
1394 """Check whether the character is part of
1395 ByzantineMusicalSymbols UCS Block """
1396 ret = libxml2mod.xmlUCSIsByzantineMusicalSymbols(code)
1397 return ret
1398
1399def uCSIsCJKCompatibility(code):
1400 """Check whether the character is part of CJKCompatibility UCS
1401 Block """
1402 ret = libxml2mod.xmlUCSIsCJKCompatibility(code)
1403 return ret
1404
1405def uCSIsCJKCompatibilityForms(code):
1406 """Check whether the character is part of
1407 CJKCompatibilityForms UCS Block """
1408 ret = libxml2mod.xmlUCSIsCJKCompatibilityForms(code)
1409 return ret
1410
1411def uCSIsCJKCompatibilityIdeographs(code):
1412 """Check whether the character is part of
1413 CJKCompatibilityIdeographs UCS Block """
1414 ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographs(code)
1415 return ret
1416
1417def uCSIsCJKCompatibilityIdeographsSupplement(code):
1418 """Check whether the character is part of
1419 CJKCompatibilityIdeographsSupplement UCS Block """
1420 ret = libxml2mod.xmlUCSIsCJKCompatibilityIdeographsSupplement(code)
1421 return ret
1422
1423def uCSIsCJKRadicalsSupplement(code):
1424 """Check whether the character is part of
1425 CJKRadicalsSupplement UCS Block """
1426 ret = libxml2mod.xmlUCSIsCJKRadicalsSupplement(code)
1427 return ret
1428
1429def uCSIsCJKSymbolsandPunctuation(code):
1430 """Check whether the character is part of
1431 CJKSymbolsandPunctuation UCS Block """
1432 ret = libxml2mod.xmlUCSIsCJKSymbolsandPunctuation(code)
1433 return ret
1434
1435def uCSIsCJKUnifiedIdeographs(code):
1436 """Check whether the character is part of CJKUnifiedIdeographs
1437 UCS Block """
1438 ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographs(code)
1439 return ret
1440
1441def uCSIsCJKUnifiedIdeographsExtensionA(code):
1442 """Check whether the character is part of
1443 CJKUnifiedIdeographsExtensionA UCS Block """
1444 ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionA(code)
1445 return ret
1446
1447def uCSIsCJKUnifiedIdeographsExtensionB(code):
1448 """Check whether the character is part of
1449 CJKUnifiedIdeographsExtensionB UCS Block """
1450 ret = libxml2mod.xmlUCSIsCJKUnifiedIdeographsExtensionB(code)
1451 return ret
1452
1453def uCSIsCat(code, cat):
1454 """Check whether the character is part of the UCS Category """
1455 ret = libxml2mod.xmlUCSIsCat(code, cat)
1456 return ret
1457
1458def uCSIsCatC(code):
1459 """Check whether the character is part of C UCS Category """
1460 ret = libxml2mod.xmlUCSIsCatC(code)
1461 return ret
1462
1463def uCSIsCatCc(code):
1464 """Check whether the character is part of Cc UCS Category """
1465 ret = libxml2mod.xmlUCSIsCatCc(code)
1466 return ret
1467
1468def uCSIsCatCf(code):
1469 """Check whether the character is part of Cf UCS Category """
1470 ret = libxml2mod.xmlUCSIsCatCf(code)
1471 return ret
1472
1473def uCSIsCatCo(code):
1474 """Check whether the character is part of Co UCS Category """
1475 ret = libxml2mod.xmlUCSIsCatCo(code)
1476 return ret
1477
1478def uCSIsCatCs(code):
1479 """Check whether the character is part of Cs UCS Category """
1480 ret = libxml2mod.xmlUCSIsCatCs(code)
1481 return ret
1482
1483def uCSIsCatL(code):
1484 """Check whether the character is part of L UCS Category """
1485 ret = libxml2mod.xmlUCSIsCatL(code)
1486 return ret
1487
1488def uCSIsCatLl(code):
1489 """Check whether the character is part of Ll UCS Category """
1490 ret = libxml2mod.xmlUCSIsCatLl(code)
1491 return ret
1492
1493def uCSIsCatLm(code):
1494 """Check whether the character is part of Lm UCS Category """
1495 ret = libxml2mod.xmlUCSIsCatLm(code)
1496 return ret
1497
1498def uCSIsCatLo(code):
1499 """Check whether the character is part of Lo UCS Category """
1500 ret = libxml2mod.xmlUCSIsCatLo(code)
1501 return ret
1502
1503def uCSIsCatLt(code):
1504 """Check whether the character is part of Lt UCS Category """
1505 ret = libxml2mod.xmlUCSIsCatLt(code)
1506 return ret
1507
1508def uCSIsCatLu(code):
1509 """Check whether the character is part of Lu UCS Category """
1510 ret = libxml2mod.xmlUCSIsCatLu(code)
1511 return ret
1512
1513def uCSIsCatM(code):
1514 """Check whether the character is part of M UCS Category """
1515 ret = libxml2mod.xmlUCSIsCatM(code)
1516 return ret
1517
1518def uCSIsCatMc(code):
1519 """Check whether the character is part of Mc UCS Category """
1520 ret = libxml2mod.xmlUCSIsCatMc(code)
1521 return ret
1522
1523def uCSIsCatMe(code):
1524 """Check whether the character is part of Me UCS Category """
1525 ret = libxml2mod.xmlUCSIsCatMe(code)
1526 return ret
1527
1528def uCSIsCatMn(code):
1529 """Check whether the character is part of Mn UCS Category """
1530 ret = libxml2mod.xmlUCSIsCatMn(code)
1531 return ret
1532
1533def uCSIsCatN(code):
1534 """Check whether the character is part of N UCS Category """
1535 ret = libxml2mod.xmlUCSIsCatN(code)
1536 return ret
1537
1538def uCSIsCatNd(code):
1539 """Check whether the character is part of Nd UCS Category """
1540 ret = libxml2mod.xmlUCSIsCatNd(code)
1541 return ret
1542
1543def uCSIsCatNl(code):
1544 """Check whether the character is part of Nl UCS Category """
1545 ret = libxml2mod.xmlUCSIsCatNl(code)
1546 return ret
1547
1548def uCSIsCatNo(code):
1549 """Check whether the character is part of No UCS Category """
1550 ret = libxml2mod.xmlUCSIsCatNo(code)
1551 return ret
1552
1553def uCSIsCatP(code):
1554 """Check whether the character is part of P UCS Category """
1555 ret = libxml2mod.xmlUCSIsCatP(code)
1556 return ret
1557
1558def uCSIsCatPc(code):
1559 """Check whether the character is part of Pc UCS Category """
1560 ret = libxml2mod.xmlUCSIsCatPc(code)
1561 return ret
1562
1563def uCSIsCatPd(code):
1564 """Check whether the character is part of Pd UCS Category """
1565 ret = libxml2mod.xmlUCSIsCatPd(code)
1566 return ret
1567
1568def uCSIsCatPe(code):
1569 """Check whether the character is part of Pe UCS Category """
1570 ret = libxml2mod.xmlUCSIsCatPe(code)
1571 return ret
1572
1573def uCSIsCatPf(code):
1574 """Check whether the character is part of Pf UCS Category """
1575 ret = libxml2mod.xmlUCSIsCatPf(code)
1576 return ret
1577
1578def uCSIsCatPi(code):
1579 """Check whether the character is part of Pi UCS Category """
1580 ret = libxml2mod.xmlUCSIsCatPi(code)
1581 return ret
1582
1583def uCSIsCatPo(code):
1584 """Check whether the character is part of Po UCS Category """
1585 ret = libxml2mod.xmlUCSIsCatPo(code)
1586 return ret
1587
1588def uCSIsCatPs(code):
1589 """Check whether the character is part of Ps UCS Category """
1590 ret = libxml2mod.xmlUCSIsCatPs(code)
1591 return ret
1592
1593def uCSIsCatS(code):
1594 """Check whether the character is part of S UCS Category """
1595 ret = libxml2mod.xmlUCSIsCatS(code)
1596 return ret
1597
1598def uCSIsCatSc(code):
1599 """Check whether the character is part of Sc UCS Category """
1600 ret = libxml2mod.xmlUCSIsCatSc(code)
1601 return ret
1602
1603def uCSIsCatSk(code):
1604 """Check whether the character is part of Sk UCS Category """
1605 ret = libxml2mod.xmlUCSIsCatSk(code)
1606 return ret
1607
1608def uCSIsCatSm(code):
1609 """Check whether the character is part of Sm UCS Category """
1610 ret = libxml2mod.xmlUCSIsCatSm(code)
1611 return ret
1612
1613def uCSIsCatSo(code):
1614 """Check whether the character is part of So UCS Category """
1615 ret = libxml2mod.xmlUCSIsCatSo(code)
1616 return ret
1617
1618def uCSIsCatZ(code):
1619 """Check whether the character is part of Z UCS Category """
1620 ret = libxml2mod.xmlUCSIsCatZ(code)
1621 return ret
1622
1623def uCSIsCatZl(code):
1624 """Check whether the character is part of Zl UCS Category """
1625 ret = libxml2mod.xmlUCSIsCatZl(code)
1626 return ret
1627
1628def uCSIsCatZp(code):
1629 """Check whether the character is part of Zp UCS Category """
1630 ret = libxml2mod.xmlUCSIsCatZp(code)
1631 return ret
1632
1633def uCSIsCatZs(code):
1634 """Check whether the character is part of Zs UCS Category """
1635 ret = libxml2mod.xmlUCSIsCatZs(code)
1636 return ret
1637
1638def uCSIsCherokee(code):
1639 """Check whether the character is part of Cherokee UCS Block """
1640 ret = libxml2mod.xmlUCSIsCherokee(code)
1641 return ret
1642
1643def uCSIsCombiningDiacriticalMarks(code):
1644 """Check whether the character is part of
1645 CombiningDiacriticalMarks UCS Block """
1646 ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarks(code)
1647 return ret
1648
1649def uCSIsCombiningDiacriticalMarksforSymbols(code):
1650 """Check whether the character is part of
1651 CombiningDiacriticalMarksforSymbols UCS Block """
1652 ret = libxml2mod.xmlUCSIsCombiningDiacriticalMarksforSymbols(code)
1653 return ret
1654
1655def uCSIsCombiningHalfMarks(code):
1656 """Check whether the character is part of CombiningHalfMarks
1657 UCS Block """
1658 ret = libxml2mod.xmlUCSIsCombiningHalfMarks(code)
1659 return ret
1660
1661def uCSIsCombiningMarksforSymbols(code):
1662 """Check whether the character is part of
1663 CombiningMarksforSymbols UCS Block """
1664 ret = libxml2mod.xmlUCSIsCombiningMarksforSymbols(code)
1665 return ret
1666
1667def uCSIsControlPictures(code):
1668 """Check whether the character is part of ControlPictures UCS
1669 Block """
1670 ret = libxml2mod.xmlUCSIsControlPictures(code)
1671 return ret
1672
1673def uCSIsCurrencySymbols(code):
1674 """Check whether the character is part of CurrencySymbols UCS
1675 Block """
1676 ret = libxml2mod.xmlUCSIsCurrencySymbols(code)
1677 return ret
1678
1679def uCSIsCypriotSyllabary(code):
1680 """Check whether the character is part of CypriotSyllabary UCS
1681 Block """
1682 ret = libxml2mod.xmlUCSIsCypriotSyllabary(code)
1683 return ret
1684
1685def uCSIsCyrillic(code):
1686 """Check whether the character is part of Cyrillic UCS Block """
1687 ret = libxml2mod.xmlUCSIsCyrillic(code)
1688 return ret
1689
1690def uCSIsCyrillicSupplement(code):
1691 """Check whether the character is part of CyrillicSupplement
1692 UCS Block """
1693 ret = libxml2mod.xmlUCSIsCyrillicSupplement(code)
1694 return ret
1695
1696def uCSIsDeseret(code):
1697 """Check whether the character is part of Deseret UCS Block """
1698 ret = libxml2mod.xmlUCSIsDeseret(code)
1699 return ret
1700
1701def uCSIsDevanagari(code):
1702 """Check whether the character is part of Devanagari UCS Block """
1703 ret = libxml2mod.xmlUCSIsDevanagari(code)
1704 return ret
1705
1706def uCSIsDingbats(code):
1707 """Check whether the character is part of Dingbats UCS Block """
1708 ret = libxml2mod.xmlUCSIsDingbats(code)
1709 return ret
1710
1711def uCSIsEnclosedAlphanumerics(code):
1712 """Check whether the character is part of
1713 EnclosedAlphanumerics UCS Block """
1714 ret = libxml2mod.xmlUCSIsEnclosedAlphanumerics(code)
1715 return ret
1716
1717def uCSIsEnclosedCJKLettersandMonths(code):
1718 """Check whether the character is part of
1719 EnclosedCJKLettersandMonths UCS Block """
1720 ret = libxml2mod.xmlUCSIsEnclosedCJKLettersandMonths(code)
1721 return ret
1722
1723def uCSIsEthiopic(code):
1724 """Check whether the character is part of Ethiopic UCS Block """
1725 ret = libxml2mod.xmlUCSIsEthiopic(code)
1726 return ret
1727
1728def uCSIsGeneralPunctuation(code):
1729 """Check whether the character is part of GeneralPunctuation
1730 UCS Block """
1731 ret = libxml2mod.xmlUCSIsGeneralPunctuation(code)
1732 return ret
1733
1734def uCSIsGeometricShapes(code):
1735 """Check whether the character is part of GeometricShapes UCS
1736 Block """
1737 ret = libxml2mod.xmlUCSIsGeometricShapes(code)
1738 return ret
1739
1740def uCSIsGeorgian(code):
1741 """Check whether the character is part of Georgian UCS Block """
1742 ret = libxml2mod.xmlUCSIsGeorgian(code)
1743 return ret
1744
1745def uCSIsGothic(code):
1746 """Check whether the character is part of Gothic UCS Block """
1747 ret = libxml2mod.xmlUCSIsGothic(code)
1748 return ret
1749
1750def uCSIsGreek(code):
1751 """Check whether the character is part of Greek UCS Block """
1752 ret = libxml2mod.xmlUCSIsGreek(code)
1753 return ret
1754
1755def uCSIsGreekExtended(code):
1756 """Check whether the character is part of GreekExtended UCS
1757 Block """
1758 ret = libxml2mod.xmlUCSIsGreekExtended(code)
1759 return ret
1760
1761def uCSIsGreekandCoptic(code):
1762 """Check whether the character is part of GreekandCoptic UCS
1763 Block """
1764 ret = libxml2mod.xmlUCSIsGreekandCoptic(code)
1765 return ret
1766
1767def uCSIsGujarati(code):
1768 """Check whether the character is part of Gujarati UCS Block """
1769 ret = libxml2mod.xmlUCSIsGujarati(code)
1770 return ret
1771
1772def uCSIsGurmukhi(code):
1773 """Check whether the character is part of Gurmukhi UCS Block """
1774 ret = libxml2mod.xmlUCSIsGurmukhi(code)
1775 return ret
1776
1777def uCSIsHalfwidthandFullwidthForms(code):
1778 """Check whether the character is part of
1779 HalfwidthandFullwidthForms UCS Block """
1780 ret = libxml2mod.xmlUCSIsHalfwidthandFullwidthForms(code)
1781 return ret
1782
1783def uCSIsHangulCompatibilityJamo(code):
1784 """Check whether the character is part of
1785 HangulCompatibilityJamo UCS Block """
1786 ret = libxml2mod.xmlUCSIsHangulCompatibilityJamo(code)
1787 return ret
1788
1789def uCSIsHangulJamo(code):
1790 """Check whether the character is part of HangulJamo UCS Block """
1791 ret = libxml2mod.xmlUCSIsHangulJamo(code)
1792 return ret
1793
1794def uCSIsHangulSyllables(code):
1795 """Check whether the character is part of HangulSyllables UCS
1796 Block """
1797 ret = libxml2mod.xmlUCSIsHangulSyllables(code)
1798 return ret
1799
1800def uCSIsHanunoo(code):
1801 """Check whether the character is part of Hanunoo UCS Block """
1802 ret = libxml2mod.xmlUCSIsHanunoo(code)
1803 return ret
1804
1805def uCSIsHebrew(code):
1806 """Check whether the character is part of Hebrew UCS Block """
1807 ret = libxml2mod.xmlUCSIsHebrew(code)
1808 return ret
1809
1810def uCSIsHighPrivateUseSurrogates(code):
1811 """Check whether the character is part of
1812 HighPrivateUseSurrogates UCS Block """
1813 ret = libxml2mod.xmlUCSIsHighPrivateUseSurrogates(code)
1814 return ret
1815
1816def uCSIsHighSurrogates(code):
1817 """Check whether the character is part of HighSurrogates UCS
1818 Block """
1819 ret = libxml2mod.xmlUCSIsHighSurrogates(code)
1820 return ret
1821
1822def uCSIsHiragana(code):
1823 """Check whether the character is part of Hiragana UCS Block """
1824 ret = libxml2mod.xmlUCSIsHiragana(code)
1825 return ret
1826
1827def uCSIsIPAExtensions(code):
1828 """Check whether the character is part of IPAExtensions UCS
1829 Block """
1830 ret = libxml2mod.xmlUCSIsIPAExtensions(code)
1831 return ret
1832
1833def uCSIsIdeographicDescriptionCharacters(code):
1834 """Check whether the character is part of
1835 IdeographicDescriptionCharacters UCS Block """
1836 ret = libxml2mod.xmlUCSIsIdeographicDescriptionCharacters(code)
1837 return ret
1838
1839def uCSIsKanbun(code):
1840 """Check whether the character is part of Kanbun UCS Block """
1841 ret = libxml2mod.xmlUCSIsKanbun(code)
1842 return ret
1843
1844def uCSIsKangxiRadicals(code):
1845 """Check whether the character is part of KangxiRadicals UCS
1846 Block """
1847 ret = libxml2mod.xmlUCSIsKangxiRadicals(code)
1848 return ret
1849
1850def uCSIsKannada(code):
1851 """Check whether the character is part of Kannada UCS Block """
1852 ret = libxml2mod.xmlUCSIsKannada(code)
1853 return ret
1854
1855def uCSIsKatakana(code):
1856 """Check whether the character is part of Katakana UCS Block """
1857 ret = libxml2mod.xmlUCSIsKatakana(code)
1858 return ret
1859
1860def uCSIsKatakanaPhoneticExtensions(code):
1861 """Check whether the character is part of
1862 KatakanaPhoneticExtensions UCS Block """
1863 ret = libxml2mod.xmlUCSIsKatakanaPhoneticExtensions(code)
1864 return ret
1865
1866def uCSIsKhmer(code):
1867 """Check whether the character is part of Khmer UCS Block """
1868 ret = libxml2mod.xmlUCSIsKhmer(code)
1869 return ret
1870
1871def uCSIsKhmerSymbols(code):
1872 """Check whether the character is part of KhmerSymbols UCS
1873 Block """
1874 ret = libxml2mod.xmlUCSIsKhmerSymbols(code)
1875 return ret
1876
1877def uCSIsLao(code):
1878 """Check whether the character is part of Lao UCS Block """
1879 ret = libxml2mod.xmlUCSIsLao(code)
1880 return ret
1881
1882def uCSIsLatin1Supplement(code):
1883 """Check whether the character is part of Latin-1Supplement
1884 UCS Block """
1885 ret = libxml2mod.xmlUCSIsLatin1Supplement(code)
1886 return ret
1887
1888def uCSIsLatinExtendedA(code):
1889 """Check whether the character is part of LatinExtended-A UCS
1890 Block """
1891 ret = libxml2mod.xmlUCSIsLatinExtendedA(code)
1892 return ret
1893
1894def uCSIsLatinExtendedAdditional(code):
1895 """Check whether the character is part of
1896 LatinExtendedAdditional UCS Block """
1897 ret = libxml2mod.xmlUCSIsLatinExtendedAdditional(code)
1898 return ret
1899
1900def uCSIsLatinExtendedB(code):
1901 """Check whether the character is part of LatinExtended-B UCS
1902 Block """
1903 ret = libxml2mod.xmlUCSIsLatinExtendedB(code)
1904 return ret
1905
1906def uCSIsLetterlikeSymbols(code):
1907 """Check whether the character is part of LetterlikeSymbols
1908 UCS Block """
1909 ret = libxml2mod.xmlUCSIsLetterlikeSymbols(code)
1910 return ret
1911
1912def uCSIsLimbu(code):
1913 """Check whether the character is part of Limbu UCS Block """
1914 ret = libxml2mod.xmlUCSIsLimbu(code)
1915 return ret
1916
1917def uCSIsLinearBIdeograms(code):
1918 """Check whether the character is part of LinearBIdeograms UCS
1919 Block """
1920 ret = libxml2mod.xmlUCSIsLinearBIdeograms(code)
1921 return ret
1922
1923def uCSIsLinearBSyllabary(code):
1924 """Check whether the character is part of LinearBSyllabary UCS
1925 Block """
1926 ret = libxml2mod.xmlUCSIsLinearBSyllabary(code)
1927 return ret
1928
1929def uCSIsLowSurrogates(code):
1930 """Check whether the character is part of LowSurrogates UCS
1931 Block """
1932 ret = libxml2mod.xmlUCSIsLowSurrogates(code)
1933 return ret
1934
1935def uCSIsMalayalam(code):
1936 """Check whether the character is part of Malayalam UCS Block """
1937 ret = libxml2mod.xmlUCSIsMalayalam(code)
1938 return ret
1939
1940def uCSIsMathematicalAlphanumericSymbols(code):
1941 """Check whether the character is part of
1942 MathematicalAlphanumericSymbols UCS Block """
1943 ret = libxml2mod.xmlUCSIsMathematicalAlphanumericSymbols(code)
1944 return ret
1945
1946def uCSIsMathematicalOperators(code):
1947 """Check whether the character is part of
1948 MathematicalOperators UCS Block """
1949 ret = libxml2mod.xmlUCSIsMathematicalOperators(code)
1950 return ret
1951
1952def uCSIsMiscellaneousMathematicalSymbolsA(code):
1953 """Check whether the character is part of
1954 MiscellaneousMathematicalSymbols-A UCS Block """
1955 ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsA(code)
1956 return ret
1957
1958def uCSIsMiscellaneousMathematicalSymbolsB(code):
1959 """Check whether the character is part of
1960 MiscellaneousMathematicalSymbols-B UCS Block """
1961 ret = libxml2mod.xmlUCSIsMiscellaneousMathematicalSymbolsB(code)
1962 return ret
1963
1964def uCSIsMiscellaneousSymbols(code):
1965 """Check whether the character is part of MiscellaneousSymbols
1966 UCS Block """
1967 ret = libxml2mod.xmlUCSIsMiscellaneousSymbols(code)
1968 return ret
1969
1970def uCSIsMiscellaneousSymbolsandArrows(code):
1971 """Check whether the character is part of
1972 MiscellaneousSymbolsandArrows UCS Block """
1973 ret = libxml2mod.xmlUCSIsMiscellaneousSymbolsandArrows(code)
1974 return ret
1975
1976def uCSIsMiscellaneousTechnical(code):
1977 """Check whether the character is part of
1978 MiscellaneousTechnical UCS Block """
1979 ret = libxml2mod.xmlUCSIsMiscellaneousTechnical(code)
1980 return ret
1981
1982def uCSIsMongolian(code):
1983 """Check whether the character is part of Mongolian UCS Block """
1984 ret = libxml2mod.xmlUCSIsMongolian(code)
1985 return ret
1986
1987def uCSIsMusicalSymbols(code):
1988 """Check whether the character is part of MusicalSymbols UCS
1989 Block """
1990 ret = libxml2mod.xmlUCSIsMusicalSymbols(code)
1991 return ret
1992
1993def uCSIsMyanmar(code):
1994 """Check whether the character is part of Myanmar UCS Block """
1995 ret = libxml2mod.xmlUCSIsMyanmar(code)
1996 return ret
1997
1998def uCSIsNumberForms(code):
1999 """Check whether the character is part of NumberForms UCS Block """
2000 ret = libxml2mod.xmlUCSIsNumberForms(code)
2001 return ret
2002
2003def uCSIsOgham(code):
2004 """Check whether the character is part of Ogham UCS Block """
2005 ret = libxml2mod.xmlUCSIsOgham(code)
2006 return ret
2007
2008def uCSIsOldItalic(code):
2009 """Check whether the character is part of OldItalic UCS Block """
2010 ret = libxml2mod.xmlUCSIsOldItalic(code)
2011 return ret
2012
2013def uCSIsOpticalCharacterRecognition(code):
2014 """Check whether the character is part of
2015 OpticalCharacterRecognition UCS Block """
2016 ret = libxml2mod.xmlUCSIsOpticalCharacterRecognition(code)
2017 return ret
2018
2019def uCSIsOriya(code):
2020 """Check whether the character is part of Oriya UCS Block """
2021 ret = libxml2mod.xmlUCSIsOriya(code)
2022 return ret
2023
2024def uCSIsOsmanya(code):
2025 """Check whether the character is part of Osmanya UCS Block """
2026 ret = libxml2mod.xmlUCSIsOsmanya(code)
2027 return ret
2028
2029def uCSIsPhoneticExtensions(code):
2030 """Check whether the character is part of PhoneticExtensions
2031 UCS Block """
2032 ret = libxml2mod.xmlUCSIsPhoneticExtensions(code)
2033 return ret
2034
2035def uCSIsPrivateUse(code):
2036 """Check whether the character is part of PrivateUse UCS Block """
2037 ret = libxml2mod.xmlUCSIsPrivateUse(code)
2038 return ret
2039
2040def uCSIsPrivateUseArea(code):
2041 """Check whether the character is part of PrivateUseArea UCS
2042 Block """
2043 ret = libxml2mod.xmlUCSIsPrivateUseArea(code)
2044 return ret
2045
2046def uCSIsRunic(code):
2047 """Check whether the character is part of Runic UCS Block """
2048 ret = libxml2mod.xmlUCSIsRunic(code)
2049 return ret
2050
2051def uCSIsShavian(code):
2052 """Check whether the character is part of Shavian UCS Block """
2053 ret = libxml2mod.xmlUCSIsShavian(code)
2054 return ret
2055
2056def uCSIsSinhala(code):
2057 """Check whether the character is part of Sinhala UCS Block """
2058 ret = libxml2mod.xmlUCSIsSinhala(code)
2059 return ret
2060
2061def uCSIsSmallFormVariants(code):
2062 """Check whether the character is part of SmallFormVariants
2063 UCS Block """
2064 ret = libxml2mod.xmlUCSIsSmallFormVariants(code)
2065 return ret
2066
2067def uCSIsSpacingModifierLetters(code):
2068 """Check whether the character is part of
2069 SpacingModifierLetters UCS Block """
2070 ret = libxml2mod.xmlUCSIsSpacingModifierLetters(code)
2071 return ret
2072
2073def uCSIsSpecials(code):
2074 """Check whether the character is part of Specials UCS Block """
2075 ret = libxml2mod.xmlUCSIsSpecials(code)
2076 return ret
2077
2078def uCSIsSuperscriptsandSubscripts(code):
2079 """Check whether the character is part of
2080 SuperscriptsandSubscripts UCS Block """
2081 ret = libxml2mod.xmlUCSIsSuperscriptsandSubscripts(code)
2082 return ret
2083
2084def uCSIsSupplementalArrowsA(code):
2085 """Check whether the character is part of SupplementalArrows-A
2086 UCS Block """
2087 ret = libxml2mod.xmlUCSIsSupplementalArrowsA(code)
2088 return ret
2089
2090def uCSIsSupplementalArrowsB(code):
2091 """Check whether the character is part of SupplementalArrows-B
2092 UCS Block """
2093 ret = libxml2mod.xmlUCSIsSupplementalArrowsB(code)
2094 return ret
2095
2096def uCSIsSupplementalMathematicalOperators(code):
2097 """Check whether the character is part of
2098 SupplementalMathematicalOperators UCS Block """
2099 ret = libxml2mod.xmlUCSIsSupplementalMathematicalOperators(code)
2100 return ret
2101
2102def uCSIsSupplementaryPrivateUseAreaA(code):
2103 """Check whether the character is part of
2104 SupplementaryPrivateUseArea-A UCS Block """
2105 ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaA(code)
2106 return ret
2107
2108def uCSIsSupplementaryPrivateUseAreaB(code):
2109 """Check whether the character is part of
2110 SupplementaryPrivateUseArea-B UCS Block """
2111 ret = libxml2mod.xmlUCSIsSupplementaryPrivateUseAreaB(code)
2112 return ret
2113
2114def uCSIsSyriac(code):
2115 """Check whether the character is part of Syriac UCS Block """
2116 ret = libxml2mod.xmlUCSIsSyriac(code)
2117 return ret
2118
2119def uCSIsTagalog(code):
2120 """Check whether the character is part of Tagalog UCS Block """
2121 ret = libxml2mod.xmlUCSIsTagalog(code)
2122 return ret
2123
2124def uCSIsTagbanwa(code):
2125 """Check whether the character is part of Tagbanwa UCS Block """
2126 ret = libxml2mod.xmlUCSIsTagbanwa(code)
2127 return ret
2128
2129def uCSIsTags(code):
2130 """Check whether the character is part of Tags UCS Block """
2131 ret = libxml2mod.xmlUCSIsTags(code)
2132 return ret
2133
2134def uCSIsTaiLe(code):
2135 """Check whether the character is part of TaiLe UCS Block """
2136 ret = libxml2mod.xmlUCSIsTaiLe(code)
2137 return ret
2138
2139def uCSIsTaiXuanJingSymbols(code):
2140 """Check whether the character is part of TaiXuanJingSymbols
2141 UCS Block """
2142 ret = libxml2mod.xmlUCSIsTaiXuanJingSymbols(code)
2143 return ret
2144
2145def uCSIsTamil(code):
2146 """Check whether the character is part of Tamil UCS Block """
2147 ret = libxml2mod.xmlUCSIsTamil(code)
2148 return ret
2149
2150def uCSIsTelugu(code):
2151 """Check whether the character is part of Telugu UCS Block """
2152 ret = libxml2mod.xmlUCSIsTelugu(code)
2153 return ret
2154
2155def uCSIsThaana(code):
2156 """Check whether the character is part of Thaana UCS Block """
2157 ret = libxml2mod.xmlUCSIsThaana(code)
2158 return ret
2159
2160def uCSIsThai(code):
2161 """Check whether the character is part of Thai UCS Block """
2162 ret = libxml2mod.xmlUCSIsThai(code)
2163 return ret
2164
2165def uCSIsTibetan(code):
2166 """Check whether the character is part of Tibetan UCS Block """
2167 ret = libxml2mod.xmlUCSIsTibetan(code)
2168 return ret
2169
2170def uCSIsUgaritic(code):
2171 """Check whether the character is part of Ugaritic UCS Block """
2172 ret = libxml2mod.xmlUCSIsUgaritic(code)
2173 return ret
2174
2175def uCSIsUnifiedCanadianAboriginalSyllabics(code):
2176 """Check whether the character is part of
2177 UnifiedCanadianAboriginalSyllabics UCS Block """
2178 ret = libxml2mod.xmlUCSIsUnifiedCanadianAboriginalSyllabics(code)
2179 return ret
2180
2181def uCSIsVariationSelectors(code):
2182 """Check whether the character is part of VariationSelectors
2183 UCS Block """
2184 ret = libxml2mod.xmlUCSIsVariationSelectors(code)
2185 return ret
2186
2187def uCSIsVariationSelectorsSupplement(code):
2188 """Check whether the character is part of
2189 VariationSelectorsSupplement UCS Block """
2190 ret = libxml2mod.xmlUCSIsVariationSelectorsSupplement(code)
2191 return ret
2192
2193def uCSIsYiRadicals(code):
2194 """Check whether the character is part of YiRadicals UCS Block """
2195 ret = libxml2mod.xmlUCSIsYiRadicals(code)
2196 return ret
2197
2198def uCSIsYiSyllables(code):
2199 """Check whether the character is part of YiSyllables UCS Block """
2200 ret = libxml2mod.xmlUCSIsYiSyllables(code)
2201 return ret
2202
2203def uCSIsYijingHexagramSymbols(code):
2204 """Check whether the character is part of
2205 YijingHexagramSymbols UCS Block """
2206 ret = libxml2mod.xmlUCSIsYijingHexagramSymbols(code)
2207 return ret
2208
2209#
2210# Functions from module xmlversion
2211#
2212
2213def checkVersion(version):
2214 """check the compiled lib version against the include one.
2215 This can warn or immediately kill the application """
2216 libxml2mod.xmlCheckVersion(version)
2217
2218#
2219# Functions from module xpathInternals
2220#
2221
2222def valuePop(ctxt):
2223 """Pops the top XPath object from the value stack """
2224 if ctxt is None: ctxt__o = None
2225 else: ctxt__o = ctxt._o
2226 ret = libxml2mod.valuePop(ctxt__o)
2227 return ret
2228
2229class xmlNode(xmlCore):
2230 def __init__(self, _obj=None):
2231 if checkWrapper(_obj) != 0: raise TypeError('xmlNode got a wrong wrapper object type')
2232 self._o = _obj
2233 xmlCore.__init__(self, _obj=_obj)
2234
2235 def __repr__(self):
2236 return "<xmlNode (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
2237
2238 # accessors for xmlNode
2239 def ns(self):
2240 """Get the namespace of a node """
2241 ret = libxml2mod.xmlNodeGetNs(self._o)
2242 if ret is None:return None
2243 __tmp = xmlNs(_obj=ret)
2244 return __tmp
2245
2246 def nsDefs(self):
2247 """Get the namespace of a node """
2248 ret = libxml2mod.xmlNodeGetNsDefs(self._o)
2249 if ret is None:return None
2250 __tmp = xmlNs(_obj=ret)
2251 return __tmp
2252
2253 #
2254 # xmlNode functions from module debugXML
2255 #
2256
2257 def debugDumpNode(self, output, depth):
2258 """Dumps debug information for the element node, it is
2259 recursive """
2260 libxml2mod.xmlDebugDumpNode(output, self._o, depth)
2261
2262 def debugDumpNodeList(self, output, depth):
2263 """Dumps debug information for the list of element node, it is
2264 recursive """
2265 libxml2mod.xmlDebugDumpNodeList(output, self._o, depth)
2266
2267 def debugDumpOneNode(self, output, depth):
2268 """Dumps debug information for the element node, it is not
2269 recursive """
2270 libxml2mod.xmlDebugDumpOneNode(output, self._o, depth)
2271
2272 def lsCountNode(self):
2273 """Count the children of @node. """
2274 ret = libxml2mod.xmlLsCountNode(self._o)
2275 return ret
2276
2277 def lsOneNode(self, output):
2278 """Dump to @output the type and name of @node. """
2279 libxml2mod.xmlLsOneNode(output, self._o)
2280
2281 def shellPrintNode(self):
2282 """Print node to the output FILE """
2283 libxml2mod.xmlShellPrintNode(self._o)
2284
2285 #
2286 # xmlNode functions from module tree
2287 #
2288
2289 def addChild(self, cur):
2290 """Add a new node to @parent, at the end of the child (or
2291 property) list merging adjacent TEXT nodes (in which case
2292 @cur is freed) If the new node is ATTRIBUTE, it is added
2293 into properties instead of children. If there is an
2294 attribute with equal name, it is first destroyed. """
2295 if cur is None: cur__o = None
2296 else: cur__o = cur._o
2297 ret = libxml2mod.xmlAddChild(self._o, cur__o)
2298 if ret is None:raise treeError('xmlAddChild() failed')
2299 __tmp = xmlNode(_obj=ret)
2300 return __tmp
2301
2302 def addChildList(self, cur):
2303 """Add a list of node at the end of the child list of the
2304 parent merging adjacent TEXT nodes (@cur may be freed) """
2305 if cur is None: cur__o = None
2306 else: cur__o = cur._o
2307 ret = libxml2mod.xmlAddChildList(self._o, cur__o)
2308 if ret is None:raise treeError('xmlAddChildList() failed')
2309 __tmp = xmlNode(_obj=ret)
2310 return __tmp
2311
2312 def addContent(self, content):
2313 """Append the extra substring to the node content. NOTE: In
2314 contrast to xmlNodeSetContent(), @content is supposed to be
2315 raw text, so unescaped XML special chars are allowed,
2316 entity references are not supported. """
2317 libxml2mod.xmlNodeAddContent(self._o, content)
2318
2319 def addContentLen(self, content, len):
2320 """Append the extra substring to the node content. NOTE: In
2321 contrast to xmlNodeSetContentLen(), @content is supposed to
2322 be raw text, so unescaped XML special chars are allowed,
2323 entity references are not supported. """
2324 libxml2mod.xmlNodeAddContentLen(self._o, content, len)
2325
2326 def addNextSibling(self, elem):
2327 """Add a new node @elem as the next sibling of @cur If the new
2328 node was already inserted in a document it is first
2329 unlinked from its existing context. As a result of text
2330 merging @elem may be freed. If the new node is ATTRIBUTE,
2331 it is added into properties instead of children. If there
2332 is an attribute with equal name, it is first destroyed. """
2333 if elem is None: elem__o = None
2334 else: elem__o = elem._o
2335 ret = libxml2mod.xmlAddNextSibling(self._o, elem__o)
2336 if ret is None:raise treeError('xmlAddNextSibling() failed')
2337 __tmp = xmlNode(_obj=ret)
2338 return __tmp
2339
2340 def addPrevSibling(self, elem):
2341 """Add a new node @elem as the previous sibling of @cur
2342 merging adjacent TEXT nodes (@elem may be freed) If the new
2343 node was already inserted in a document it is first
2344 unlinked from its existing context. If the new node is
2345 ATTRIBUTE, it is added into properties instead of children.
2346 If there is an attribute with equal name, it is first
2347 destroyed. """
2348 if elem is None: elem__o = None
2349 else: elem__o = elem._o
2350 ret = libxml2mod.xmlAddPrevSibling(self._o, elem__o)
2351 if ret is None:raise treeError('xmlAddPrevSibling() failed')
2352 __tmp = xmlNode(_obj=ret)
2353 return __tmp
2354
2355 def addSibling(self, elem):
2356 """Add a new element @elem to the list of siblings of @cur
2357 merging adjacent TEXT nodes (@elem may be freed) If the new
2358 element was already inserted in a document it is first
2359 unlinked from its existing context. """
2360 if elem is None: elem__o = None
2361 else: elem__o = elem._o
2362 ret = libxml2mod.xmlAddSibling(self._o, elem__o)
2363 if ret is None:raise treeError('xmlAddSibling() failed')
2364 __tmp = xmlNode(_obj=ret)
2365 return __tmp
2366
2367 def copyNode(self, extended):
2368 """Do a copy of the node. """
2369 ret = libxml2mod.xmlCopyNode(self._o, extended)
2370 if ret is None:raise treeError('xmlCopyNode() failed')
2371 __tmp = xmlNode(_obj=ret)
2372 return __tmp
2373
2374 def copyNodeList(self):
2375 """Do a recursive copy of the node list. Use
2376 xmlDocCopyNodeList() if possible to ensure string interning. """
2377 ret = libxml2mod.xmlCopyNodeList(self._o)
2378 if ret is None:raise treeError('xmlCopyNodeList() failed')
2379 __tmp = xmlNode(_obj=ret)
2380 return __tmp
2381
2382 def copyProp(self, cur):
2383 """Do a copy of the attribute. """
2384 if cur is None: cur__o = None
2385 else: cur__o = cur._o
2386 ret = libxml2mod.xmlCopyProp(self._o, cur__o)
2387 if ret is None:raise treeError('xmlCopyProp() failed')
2388 __tmp = xmlAttr(_obj=ret)
2389 return __tmp
2390
2391 def copyPropList(self, cur):
2392 """Do a copy of an attribute list. """
2393 if cur is None: cur__o = None
2394 else: cur__o = cur._o
2395 ret = libxml2mod.xmlCopyPropList(self._o, cur__o)
2396 if ret is None:raise treeError('xmlCopyPropList() failed')
2397 __tmp = xmlAttr(_obj=ret)
2398 return __tmp
2399
2400 def docCopyNode(self, doc, extended):
2401 """Do a copy of the node to a given document. """
2402 if doc is None: doc__o = None
2403 else: doc__o = doc._o
2404 ret = libxml2mod.xmlDocCopyNode(self._o, doc__o, extended)
2405 if ret is None:raise treeError('xmlDocCopyNode() failed')
2406 __tmp = xmlNode(_obj=ret)
2407 return __tmp
2408
2409 def docCopyNodeList(self, doc):
2410 """Do a recursive copy of the node list. """
2411 if doc is None: doc__o = None
2412 else: doc__o = doc._o
2413 ret = libxml2mod.xmlDocCopyNodeList(doc__o, self._o)
2414 if ret is None:raise treeError('xmlDocCopyNodeList() failed')
2415 __tmp = xmlNode(_obj=ret)
2416 return __tmp
2417
2418 def docSetRootElement(self, doc):
2419 """Set the root element of the document (doc->children is a
2420 list containing possibly comments, PIs, etc ...). """
2421 if doc is None: doc__o = None
2422 else: doc__o = doc._o
2423 ret = libxml2mod.xmlDocSetRootElement(doc__o, self._o)
2424 if ret is None:return None
2425 __tmp = xmlNode(_obj=ret)
2426 return __tmp
2427
2428 def firstElementChild(self):
2429 """Finds the first child node of that element which is a
2430 Element node Note the handling of entities references is
2431 different than in the W3C DOM element traversal spec since
2432 we don't have back reference from entities content to
2433 entities references. """
2434 ret = libxml2mod.xmlFirstElementChild(self._o)
2435 if ret is None:return None
2436 __tmp = xmlNode(_obj=ret)
2437 return __tmp
2438
2439 def freeNode(self):
2440 """Free a node, this is a recursive behaviour, all the
2441 children are freed too. This doesn't unlink the child from
2442 the list, use xmlUnlinkNode() first. """
2443 libxml2mod.xmlFreeNode(self._o)
2444
2445 def freeNodeList(self):
2446 """Free a node and all its siblings, this is a recursive
2447 behaviour, all the children are freed too. """
2448 libxml2mod.xmlFreeNodeList(self._o)
2449
2450 def getBase(self, doc):
2451 """Searches for the BASE URL. The code should work on both XML
2452 and HTML document even if base mechanisms are completely
2453 different. It returns the base as defined in RFC 2396
2454 sections 5.1.1. Base URI within Document Content and 5.1.2.
2455 Base URI from the Encapsulating Entity However it does not
2456 return the document base (5.1.3), use doc->URL in this case """
2457 if doc is None: doc__o = None
2458 else: doc__o = doc._o
2459 ret = libxml2mod.xmlNodeGetBase(doc__o, self._o)
2460 return ret
2461
2462 def getContent(self):
2463 """Read the value of a node, this can be either the text
2464 carried directly by this node if it's a TEXT node or the
2465 aggregate string of the values carried by this node child's
2466 (TEXT and ENTITY_REF). Entity references are substituted. """
2467 ret = libxml2mod.xmlNodeGetContent(self._o)
2468 return ret
2469
2470 def getLang(self):
2471 """Searches the language of a node, i.e. the values of the
2472 xml:lang attribute or the one carried by the nearest
2473 ancestor. """
2474 ret = libxml2mod.xmlNodeGetLang(self._o)
2475 return ret
2476
2477 def getSpacePreserve(self):
2478 """Searches the space preserving behaviour of a node, i.e. the
2479 values of the xml:space attribute or the one carried by the
2480 nearest ancestor. """
2481 ret = libxml2mod.xmlNodeGetSpacePreserve(self._o)
2482 return ret
2483
2484 def hasNsProp(self, name, nameSpace):
2485 """Search for an attribute associated to a node This attribute
2486 has to be anchored in the namespace specified. This does
2487 the entity substitution. This function looks in DTD
2488 attribute declaration for #FIXED or default declaration
2489 values unless DTD use has been turned off. Note that a
2490 namespace of None indicates to use the default namespace. """
2491 ret = libxml2mod.xmlHasNsProp(self._o, name, nameSpace)
2492 if ret is None:return None
2493 __tmp = xmlAttr(_obj=ret)
2494 return __tmp
2495
2496 def hasProp(self, name):
2497 """Search an attribute associated to a node This function also
2498 looks in DTD attribute declaration for #FIXED or default
2499 declaration values unless DTD use has been turned off. """
2500 ret = libxml2mod.xmlHasProp(self._o, name)
2501 if ret is None:return None
2502 __tmp = xmlAttr(_obj=ret)
2503 return __tmp
2504
2505 def isBlankNode(self):
2506 """Checks whether this node is an empty or whitespace only
2507 (and possibly ignorable) text-node. """
2508 ret = libxml2mod.xmlIsBlankNode(self._o)
2509 return ret
2510
2511 def isText(self):
2512 """Is this node a Text node ? """
2513 ret = libxml2mod.xmlNodeIsText(self._o)
2514 return ret
2515
2516 def lastChild(self):
2517 """Search the last child of a node. """
2518 ret = libxml2mod.xmlGetLastChild(self._o)
2519 if ret is None:raise treeError('xmlGetLastChild() failed')
2520 __tmp = xmlNode(_obj=ret)
2521 return __tmp
2522
2523 def lastElementChild(self):
2524 """Finds the last child node of that element which is a
2525 Element node Note the handling of entities references is
2526 different than in the W3C DOM element traversal spec since
2527 we don't have back reference from entities content to
2528 entities references. """
2529 ret = libxml2mod.xmlLastElementChild(self._o)
2530 if ret is None:return None
2531 __tmp = xmlNode(_obj=ret)
2532 return __tmp
2533
2534 def lineNo(self):
2535 """Get line number of @node. Try to override the limitation of
2536 lines being store in 16 bits ints if XML_PARSE_BIG_LINES
2537 parser option was used """
2538 ret = libxml2mod.xmlGetLineNo(self._o)
2539 return ret
2540
2541 def listGetRawString(self, doc, inLine):
2542 """Builds the string equivalent to the text contained in the
2543 Node list made of TEXTs and ENTITY_REFs, contrary to
2544 xmlNodeListGetString() this function doesn't do any
2545 character encoding handling. """
2546 if doc is None: doc__o = None
2547 else: doc__o = doc._o
2548 ret = libxml2mod.xmlNodeListGetRawString(doc__o, self._o, inLine)
2549 return ret
2550
2551 def listGetString(self, doc, inLine):
2552 """Build the string equivalent to the text contained in the
2553 Node list made of TEXTs and ENTITY_REFs """
2554 if doc is None: doc__o = None
2555 else: doc__o = doc._o
2556 ret = libxml2mod.xmlNodeListGetString(doc__o, self._o, inLine)
2557 return ret
2558
2559 def newChild(self, ns, name, content):
2560 """Creation of a new child element, added at the end of
2561 @parent children list. @ns and @content parameters are
2562 optional (None). If @ns is None, the newly created element
2563 inherits the namespace of @parent. If @content is non None,
2564 a child list containing the TEXTs and ENTITY_REFs node will
2565 be created. NOTE: @content is supposed to be a piece of XML
2566 CDATA, so it allows entity references. XML special chars
2567 must be escaped first by using
2568 xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
2569 be used. """
2570 if ns is None: ns__o = None
2571 else: ns__o = ns._o
2572 ret = libxml2mod.xmlNewChild(self._o, ns__o, name, content)
2573 if ret is None:raise treeError('xmlNewChild() failed')
2574 __tmp = xmlNode(_obj=ret)
2575 return __tmp
2576
2577 def newNs(self, href, prefix):
2578 """Creation of a new Namespace. This function will refuse to
2579 create a namespace with a similar prefix than an existing
2580 one present on this node. Note that for a default
2581 namespace, @prefix should be None. We use href==None in
2582 the case of an element creation where the namespace was not
2583 defined. """
2584 ret = libxml2mod.xmlNewNs(self._o, href, prefix)
2585 if ret is None:raise treeError('xmlNewNs() failed')
2586 __tmp = xmlNs(_obj=ret)
2587 return __tmp
2588
2589 def newNsProp(self, ns, name, value):
2590 """Create a new property tagged with a namespace and carried
2591 by a node. """
2592 if ns is None: ns__o = None
2593 else: ns__o = ns._o
2594 ret = libxml2mod.xmlNewNsProp(self._o, ns__o, name, value)
2595 if ret is None:raise treeError('xmlNewNsProp() failed')
2596 __tmp = xmlAttr(_obj=ret)
2597 return __tmp
2598
2599 def newNsPropEatName(self, ns, name, value):
2600 """Create a new property tagged with a namespace and carried
2601 by a node. """
2602 if ns is None: ns__o = None
2603 else: ns__o = ns._o
2604 ret = libxml2mod.xmlNewNsPropEatName(self._o, ns__o, name, value)
2605 if ret is None:raise treeError('xmlNewNsPropEatName() failed')
2606 __tmp = xmlAttr(_obj=ret)
2607 return __tmp
2608
2609 def newProp(self, name, value):
2610 """Create a new property carried by a node. """
2611 ret = libxml2mod.xmlNewProp(self._o, name, value)
2612 if ret is None:raise treeError('xmlNewProp() failed')
2613 __tmp = xmlAttr(_obj=ret)
2614 return __tmp
2615
2616 def newTextChild(self, ns, name, content):
2617 """Creation of a new child element, added at the end of
2618 @parent children list. @ns and @content parameters are
2619 optional (None). If @ns is None, the newly created element
2620 inherits the namespace of @parent. If @content is non None,
2621 a child TEXT node will be created containing the string
2622 @content. NOTE: Use xmlNewChild() if @content will contain
2623 entities that need to be preserved. Use this function,
2624 xmlNewTextChild(), if you need to ensure that reserved XML
2625 chars that might appear in @content, such as the ampersand,
2626 greater-than or less-than signs, are automatically replaced
2627 by their XML escaped entity representations. """
2628 if ns is None: ns__o = None
2629 else: ns__o = ns._o
2630 ret = libxml2mod.xmlNewTextChild(self._o, ns__o, name, content)
2631 if ret is None:raise treeError('xmlNewTextChild() failed')
2632 __tmp = xmlNode(_obj=ret)
2633 return __tmp
2634
2635 def nextElementSibling(self):
2636 """Finds the first closest next sibling of the node which is
2637 an element node. Note the handling of entities references
2638 is different than in the W3C DOM element traversal spec
2639 since we don't have back reference from entities content to
2640 entities references. """
2641 ret = libxml2mod.xmlNextElementSibling(self._o)
2642 if ret is None:return None
2643 __tmp = xmlNode(_obj=ret)
2644 return __tmp
2645
2646 def noNsProp(self, name):
2647 """Search and get the value of an attribute associated to a
2648 node This does the entity substitution. This function looks
2649 in DTD attribute declaration for #FIXED or default
2650 declaration values unless DTD use has been turned off. This
2651 function is similar to xmlGetProp except it will accept
2652 only an attribute in no namespace. """
2653 ret = libxml2mod.xmlGetNoNsProp(self._o, name)
2654 return ret
2655
2656 def nodePath(self):
2657 """Build a structure based Path for the given node """
2658 ret = libxml2mod.xmlGetNodePath(self._o)
2659 return ret
2660
2661 def nsProp(self, name, nameSpace):
2662 """Search and get the value of an attribute associated to a
2663 node This attribute has to be anchored in the namespace
2664 specified. This does the entity substitution. This function
2665 looks in DTD attribute declaration for #FIXED or default
2666 declaration values unless DTD use has been turned off. """
2667 ret = libxml2mod.xmlGetNsProp(self._o, name, nameSpace)
2668 return ret
2669
2670 def previousElementSibling(self):
2671 """Finds the first closest previous sibling of the node which
2672 is an element node. Note the handling of entities
2673 references is different than in the W3C DOM element
2674 traversal spec since we don't have back reference from
2675 entities content to entities references. """
2676 ret = libxml2mod.xmlPreviousElementSibling(self._o)
2677 if ret is None:return None
2678 __tmp = xmlNode(_obj=ret)
2679 return __tmp
2680
2681 def prop(self, name):
2682 """Search and get the value of an attribute associated to a
2683 node This does the entity substitution. This function looks
2684 in DTD attribute declaration for #FIXED or default
2685 declaration values unless DTD use has been turned off.
2686 NOTE: this function acts independently of namespaces
2687 associated to the attribute. Use xmlGetNsProp() or
2688 xmlGetNoNsProp() for namespace aware processing. """
2689 ret = libxml2mod.xmlGetProp(self._o, name)
2690 return ret
2691
2692 def reconciliateNs(self, doc):
2693 """This function checks that all the namespaces declared
2694 within the given tree are properly declared. This is needed
2695 for example after Copy or Cut and then paste operations.
2696 The subtree may still hold pointers to namespace
2697 declarations outside the subtree or invalid/masked. As much
2698 as possible the function try to reuse the existing
2699 namespaces found in the new environment. If not possible
2700 the new namespaces are redeclared on @tree at the top of
2701 the given subtree. """
2702 if doc is None: doc__o = None
2703 else: doc__o = doc._o
2704 ret = libxml2mod.xmlReconciliateNs(doc__o, self._o)
2705 return ret
2706
2707 def replaceNode(self, cur):
2708 """Unlink the old node from its current context, prune the new
2709 one at the same place. If @cur was already inserted in a
2710 document it is first unlinked from its existing context. """
2711 if cur is None: cur__o = None
2712 else: cur__o = cur._o
2713 ret = libxml2mod.xmlReplaceNode(self._o, cur__o)
2714 if ret is None:raise treeError('xmlReplaceNode() failed')
2715 __tmp = xmlNode(_obj=ret)
2716 return __tmp
2717
2718 def searchNs(self, doc, nameSpace):
2719 """Search a Ns registered under a given name space for a
2720 document. recurse on the parents until it finds the defined
2721 namespace or return None otherwise. @nameSpace can be None,
2722 this is a search for the default namespace. We don't allow
2723 to cross entities boundaries. If you don't declare the
2724 namespace within those you will be in troubles !!! A
2725 warning is generated to cover this case. """
2726 if doc is None: doc__o = None
2727 else: doc__o = doc._o
2728 ret = libxml2mod.xmlSearchNs(doc__o, self._o, nameSpace)
2729 if ret is None:raise treeError('xmlSearchNs() failed')
2730 __tmp = xmlNs(_obj=ret)
2731 return __tmp
2732
2733 def searchNsByHref(self, doc, href):
2734 """Search a Ns aliasing a given URI. Recurse on the parents
2735 until it finds the defined namespace or return None
2736 otherwise. """
2737 if doc is None: doc__o = None
2738 else: doc__o = doc._o
2739 ret = libxml2mod.xmlSearchNsByHref(doc__o, self._o, href)
2740 if ret is None:raise treeError('xmlSearchNsByHref() failed')
2741 __tmp = xmlNs(_obj=ret)
2742 return __tmp
2743
2744 def setBase(self, uri):
2745 """Set (or reset) the base URI of a node, i.e. the value of
2746 the xml:base attribute. """
2747 libxml2mod.xmlNodeSetBase(self._o, uri)
2748
2749 def setContent(self, content):
2750 """Replace the content of a node. NOTE: @content is supposed
2751 to be a piece of XML CDATA, so it allows entity references,
2752 but XML special chars need to be escaped first by using
2753 xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
2754 libxml2mod.xmlNodeSetContent(self._o, content)
2755
2756 def setContentLen(self, content, len):
2757 """Replace the content of a node. NOTE: @content is supposed
2758 to be a piece of XML CDATA, so it allows entity references,
2759 but XML special chars need to be escaped first by using
2760 xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
2761 libxml2mod.xmlNodeSetContentLen(self._o, content, len)
2762
2763 def setLang(self, lang):
2764 """Set the language of a node, i.e. the values of the xml:lang
2765 attribute. """
2766 libxml2mod.xmlNodeSetLang(self._o, lang)
2767
2768 def setListDoc(self, doc):
2769 """update all nodes in the list to point to the right document """
2770 if doc is None: doc__o = None
2771 else: doc__o = doc._o
2772 libxml2mod.xmlSetListDoc(self._o, doc__o)
2773
2774 def setName(self, name):
2775 """Set (or reset) the name of a node. """
2776 libxml2mod.xmlNodeSetName(self._o, name)
2777
2778 def setNs(self, ns):
2779 """Associate a namespace to a node, a posteriori. """
2780 if ns is None: ns__o = None
2781 else: ns__o = ns._o
2782 libxml2mod.xmlSetNs(self._o, ns__o)
2783
2784 def setNsProp(self, ns, name, value):
2785 """Set (or reset) an attribute carried by a node. The ns
2786 structure must be in scope, this is not checked """
2787 if ns is None: ns__o = None
2788 else: ns__o = ns._o
2789 ret = libxml2mod.xmlSetNsProp(self._o, ns__o, name, value)
2790 if ret is None:raise treeError('xmlSetNsProp() failed')
2791 __tmp = xmlAttr(_obj=ret)
2792 return __tmp
2793
2794 def setProp(self, name, value):
2795 """Set (or reset) an attribute carried by a node. If @name has
2796 a prefix, then the corresponding namespace-binding will be
2797 used, if in scope; it is an error it there's no such
2798 ns-binding for the prefix in scope. """
2799 ret = libxml2mod.xmlSetProp(self._o, name, value)
2800 if ret is None:raise treeError('xmlSetProp() failed')
2801 __tmp = xmlAttr(_obj=ret)
2802 return __tmp
2803
2804 def setSpacePreserve(self, val):
2805 """Set (or reset) the space preserving behaviour of a node,
2806 i.e. the value of the xml:space attribute. """
2807 libxml2mod.xmlNodeSetSpacePreserve(self._o, val)
2808
2809 def setTreeDoc(self, doc):
2810 """update all nodes under the tree to point to the right
2811 document """
2812 if doc is None: doc__o = None
2813 else: doc__o = doc._o
2814 libxml2mod.xmlSetTreeDoc(self._o, doc__o)
2815
2816 def textConcat(self, content, len):
2817 """Concat the given string at the end of the existing node
2818 content """
2819 ret = libxml2mod.xmlTextConcat(self._o, content, len)
2820 return ret
2821
2822 def textMerge(self, second):
2823 """Merge two text nodes into one """
2824 if second is None: second__o = None
2825 else: second__o = second._o
2826 ret = libxml2mod.xmlTextMerge(self._o, second__o)
2827 if ret is None:raise treeError('xmlTextMerge() failed')
2828 __tmp = xmlNode(_obj=ret)
2829 return __tmp
2830
2831 def unlinkNode(self):
2832 """Unlink a node from it's current context, the node is not
2833 freed If one need to free the node, use xmlFreeNode()
2834 routine after the unlink to discard it. Note that namespace
2835 nodes can't be unlinked as they do not have pointer to
2836 their parent. """
2837 libxml2mod.xmlUnlinkNode(self._o)
2838
2839 def unsetNsProp(self, ns, name):
2840 """Remove an attribute carried by a node. """
2841 if ns is None: ns__o = None
2842 else: ns__o = ns._o
2843 ret = libxml2mod.xmlUnsetNsProp(self._o, ns__o, name)
2844 return ret
2845
2846 def unsetProp(self, name):
2847 """Remove an attribute carried by a node. This handles only
2848 attributes in no namespace. """
2849 ret = libxml2mod.xmlUnsetProp(self._o, name)
2850 return ret
2851
2852 #
2853 # xmlNode functions from module valid
2854 #
2855
2856 def isID(self, doc, attr):
2857 """Determine whether an attribute is of type ID. In case we
2858 have DTD(s) then this is done if DTD loading has been
2859 requested. In the case of HTML documents parsed with the
2860 HTML parser, then ID detection is done systematically. """
2861 if doc is None: doc__o = None
2862 else: doc__o = doc._o
2863 if attr is None: attr__o = None
2864 else: attr__o = attr._o
2865 ret = libxml2mod.xmlIsID(doc__o, self._o, attr__o)
2866 return ret
2867
2868 def isRef(self, doc, attr):
2869 """Determine whether an attribute is of type Ref. In case we
2870 have DTD(s) then this is simple, otherwise we use an
2871 heuristic: name Ref (upper or lowercase). """
2872 if doc is None: doc__o = None
2873 else: doc__o = doc._o
2874 if attr is None: attr__o = None
2875 else: attr__o = attr._o
2876 ret = libxml2mod.xmlIsRef(doc__o, self._o, attr__o)
2877 return ret
2878
2879 def validNormalizeAttributeValue(self, doc, name, value):
2880 """Does the validation related extra step of the normalization
2881 of attribute values: If the declared value is not CDATA,
2882 then the XML processor must further process the normalized
2883 attribute value by discarding any leading and trailing
2884 space (#x20) characters, and by replacing sequences of
2885 space (#x20) characters by single space (#x20) character. """
2886 if doc is None: doc__o = None
2887 else: doc__o = doc._o
2888 ret = libxml2mod.xmlValidNormalizeAttributeValue(doc__o, self._o, name, value)
2889 return ret
2890
2891 #
2892 # xmlNode functions from module xinclude
2893 #
2894
2895 def xincludeProcessTree(self):
2896 """Implement the XInclude substitution for the given subtree """
2897 ret = libxml2mod.xmlXIncludeProcessTree(self._o)
2898 return ret
2899
2900 def xincludeProcessTreeFlags(self, flags):
2901 """Implement the XInclude substitution for the given subtree """
2902 ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags)
2903 return ret
2904
2905 #
2906 # xmlNode functions from module xmlschemas
2907 #
2908
2909 def schemaValidateOneElement(self, ctxt):
2910 """Validate a branch of a tree, starting with the given @elem. """
2911 if ctxt is None: ctxt__o = None
2912 else: ctxt__o = ctxt._o
2913 ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)
2914 return ret
2915
2916 #
2917 # xmlNode functions from module xpath
2918 #
2919
2920 def xpathCastNodeToNumber(self):
2921 """Converts a node to its number value """
2922 ret = libxml2mod.xmlXPathCastNodeToNumber(self._o)
2923 return ret
2924
2925 def xpathCastNodeToString(self):
2926 """Converts a node to its string value. """
2927 ret = libxml2mod.xmlXPathCastNodeToString(self._o)
2928 return ret
2929
2930 def xpathCmpNodes(self, node2):
2931 """Compare two nodes w.r.t document order """
2932 if node2 is None: node2__o = None
2933 else: node2__o = node2._o
2934 ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o)
2935 return ret
2936
2937 def xpathNodeEval(self, str, ctx):
2938 """Evaluate the XPath Location Path in the given context. The
2939 node 'node' is set as the context node. The context node is
2940 not restored. """
2941 if ctx is None: ctx__o = None
2942 else: ctx__o = ctx._o
2943 ret = libxml2mod.xmlXPathNodeEval(self._o, str, ctx__o)
2944 if ret is None:raise xpathError('xmlXPathNodeEval() failed')
2945 return xpathObjectRet(ret)
2946
2947 #
2948 # xmlNode functions from module xpathInternals
2949 #
2950
2951 def xpathNewNodeSet(self):
2952 """Create a new xmlXPathObjectPtr of type NodeSet and
2953 initialize it with the single Node @val """
2954 ret = libxml2mod.xmlXPathNewNodeSet(self._o)
2955 if ret is None:raise xpathError('xmlXPathNewNodeSet() failed')
2956 return xpathObjectRet(ret)
2957
2958 def xpathNewValueTree(self):
2959 """Create a new xmlXPathObjectPtr of type Value Tree (XSLT)
2960 and initialize it with the tree root @val """
2961 ret = libxml2mod.xmlXPathNewValueTree(self._o)
2962 if ret is None:raise xpathError('xmlXPathNewValueTree() failed')
2963 return xpathObjectRet(ret)
2964
2965 def xpathNextAncestor(self, ctxt):
2966 """Traversal function for the "ancestor" direction the
2967 ancestor axis contains the ancestors of the context node;
2968 the ancestors of the context node consist of the parent of
2969 context node and the parent's parent and so on; the nodes
2970 are ordered in reverse document order; thus the parent is
2971 the first node on the axis, and the parent's parent is the
2972 second node on the axis """
2973 if ctxt is None: ctxt__o = None
2974 else: ctxt__o = ctxt._o
2975 ret = libxml2mod.xmlXPathNextAncestor(ctxt__o, self._o)
2976 if ret is None:raise xpathError('xmlXPathNextAncestor() failed')
2977 __tmp = xmlNode(_obj=ret)
2978 return __tmp
2979
2980 def xpathNextAncestorOrSelf(self, ctxt):
2981 """Traversal function for the "ancestor-or-self" direction he
2982 ancestor-or-self axis contains the context node and
2983 ancestors of the context node in reverse document order;
2984 thus the context node is the first node on the axis, and
2985 the context node's parent the second; parent here is
2986 defined the same as with the parent axis. """
2987 if ctxt is None: ctxt__o = None
2988 else: ctxt__o = ctxt._o
2989 ret = libxml2mod.xmlXPathNextAncestorOrSelf(ctxt__o, self._o)
2990 if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
2991 __tmp = xmlNode(_obj=ret)
2992 return __tmp
2993
2994 def xpathNextAttribute(self, ctxt):
2995 """Traversal function for the "attribute" direction TODO:
2996 support DTD inherited default attributes """
2997 if ctxt is None: ctxt__o = None
2998 else: ctxt__o = ctxt._o
2999 ret = libxml2mod.xmlXPathNextAttribute(ctxt__o, self._o)
3000 if ret is None:raise xpathError('xmlXPathNextAttribute() failed')
3001 __tmp = xmlNode(_obj=ret)
3002 return __tmp
3003
3004 def xpathNextChild(self, ctxt):
3005 """Traversal function for the "child" direction The child axis
3006 contains the children of the context node in document order. """
3007 if ctxt is None: ctxt__o = None
3008 else: ctxt__o = ctxt._o
3009 ret = libxml2mod.xmlXPathNextChild(ctxt__o, self._o)
3010 if ret is None:raise xpathError('xmlXPathNextChild() failed')
3011 __tmp = xmlNode(_obj=ret)
3012 return __tmp
3013
3014 def xpathNextDescendant(self, ctxt):
3015 """Traversal function for the "descendant" direction the
3016 descendant axis contains the descendants of the context
3017 node in document order; a descendant is a child or a child
3018 of a child and so on. """
3019 if ctxt is None: ctxt__o = None
3020 else: ctxt__o = ctxt._o
3021 ret = libxml2mod.xmlXPathNextDescendant(ctxt__o, self._o)
3022 if ret is None:raise xpathError('xmlXPathNextDescendant() failed')
3023 __tmp = xmlNode(_obj=ret)
3024 return __tmp
3025
3026 def xpathNextDescendantOrSelf(self, ctxt):
3027 """Traversal function for the "descendant-or-self" direction
3028 the descendant-or-self axis contains the context node and
3029 the descendants of the context node in document order; thus
3030 the context node is the first node on the axis, and the
3031 first child of the context node is the second node on the
3032 axis """
3033 if ctxt is None: ctxt__o = None
3034 else: ctxt__o = ctxt._o
3035 ret = libxml2mod.xmlXPathNextDescendantOrSelf(ctxt__o, self._o)
3036 if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed')
3037 __tmp = xmlNode(_obj=ret)
3038 return __tmp
3039
3040 def xpathNextFollowing(self, ctxt):
3041 """Traversal function for the "following" direction The
3042 following axis contains all nodes in the same document as
3043 the context node that are after the context node in
3044 document order, excluding any descendants and excluding
3045 attribute nodes and namespace nodes; the nodes are ordered
3046 in document order """
3047 if ctxt is None: ctxt__o = None
3048 else: ctxt__o = ctxt._o
3049 ret = libxml2mod.xmlXPathNextFollowing(ctxt__o, self._o)
3050 if ret is None:raise xpathError('xmlXPathNextFollowing() failed')
3051 __tmp = xmlNode(_obj=ret)
3052 return __tmp
3053
3054 def xpathNextFollowingSibling(self, ctxt):
3055 """Traversal function for the "following-sibling" direction
3056 The following-sibling axis contains the following siblings
3057 of the context node in document order. """
3058 if ctxt is None: ctxt__o = None
3059 else: ctxt__o = ctxt._o
3060 ret = libxml2mod.xmlXPathNextFollowingSibling(ctxt__o, self._o)
3061 if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed')
3062 __tmp = xmlNode(_obj=ret)
3063 return __tmp
3064
3065 def xpathNextNamespace(self, ctxt):
3066 """Traversal function for the "namespace" direction the
3067 namespace axis contains the namespace nodes of the context
3068 node; the order of nodes on this axis is
3069 implementation-defined; the axis will be empty unless the
3070 context node is an element We keep the XML namespace node
3071 at the end of the list. """
3072 if ctxt is None: ctxt__o = None
3073 else: ctxt__o = ctxt._o
3074 ret = libxml2mod.xmlXPathNextNamespace(ctxt__o, self._o)
3075 if ret is None:raise xpathError('xmlXPathNextNamespace() failed')
3076 __tmp = xmlNode(_obj=ret)
3077 return __tmp
3078
3079 def xpathNextParent(self, ctxt):
3080 """Traversal function for the "parent" direction The parent
3081 axis contains the parent of the context node, if there is
3082 one. """
3083 if ctxt is None: ctxt__o = None
3084 else: ctxt__o = ctxt._o
3085 ret = libxml2mod.xmlXPathNextParent(ctxt__o, self._o)
3086 if ret is None:raise xpathError('xmlXPathNextParent() failed')
3087 __tmp = xmlNode(_obj=ret)
3088 return __tmp
3089
3090 def xpathNextPreceding(self, ctxt):
3091 """Traversal function for the "preceding" direction the
3092 preceding axis contains all nodes in the same document as
3093 the context node that are before the context node in
3094 document order, excluding any ancestors and excluding
3095 attribute nodes and namespace nodes; the nodes are ordered
3096 in reverse document order """
3097 if ctxt is None: ctxt__o = None
3098 else: ctxt__o = ctxt._o
3099 ret = libxml2mod.xmlXPathNextPreceding(ctxt__o, self._o)
3100 if ret is None:raise xpathError('xmlXPathNextPreceding() failed')
3101 __tmp = xmlNode(_obj=ret)
3102 return __tmp
3103
3104 def xpathNextPrecedingSibling(self, ctxt):
3105 """Traversal function for the "preceding-sibling" direction
3106 The preceding-sibling axis contains the preceding siblings
3107 of the context node in reverse document order; the first
3108 preceding sibling is first on the axis; the sibling
3109 preceding that node is the second on the axis and so on. """
3110 if ctxt is None: ctxt__o = None
3111 else: ctxt__o = ctxt._o
3112 ret = libxml2mod.xmlXPathNextPrecedingSibling(ctxt__o, self._o)
3113 if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed')
3114 __tmp = xmlNode(_obj=ret)
3115 return __tmp
3116
3117 def xpathNextSelf(self, ctxt):
3118 """Traversal function for the "self" direction The self axis
3119 contains just the context node itself """
3120 if ctxt is None: ctxt__o = None
3121 else: ctxt__o = ctxt._o
3122 ret = libxml2mod.xmlXPathNextSelf(ctxt__o, self._o)
3123 if ret is None:raise xpathError('xmlXPathNextSelf() failed')
3124 __tmp = xmlNode(_obj=ret)
3125 return __tmp
3126
3127 #
3128 # xmlNode functions from module xpointer
3129 #
3130
3131 def xpointerNewCollapsedRange(self):
3132 """Create a new xmlXPathObjectPtr of type range using a single
3133 nodes """
3134 ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o)
3135 if ret is None:raise treeError('xmlXPtrNewCollapsedRange() failed')
3136 return xpathObjectRet(ret)
3137
3138 def xpointerNewContext(self, doc, origin):
3139 """Create a new XPointer context """
3140 if doc is None: doc__o = None
3141 else: doc__o = doc._o
3142 if origin is None: origin__o = None
3143 else: origin__o = origin._o
3144 ret = libxml2mod.xmlXPtrNewContext(doc__o, self._o, origin__o)
3145 if ret is None:raise treeError('xmlXPtrNewContext() failed')
3146 __tmp = xpathContext(_obj=ret)
3147 return __tmp
3148
3149 def xpointerNewLocationSetNodes(self, end):
3150 """Create a new xmlXPathObjectPtr of type LocationSet and
3151 initialize it with the single range made of the two nodes
3152 @start and @end """
3153 if end is None: end__o = None
3154 else: end__o = end._o
3155 ret = libxml2mod.xmlXPtrNewLocationSetNodes(self._o, end__o)
3156 if ret is None:raise treeError('xmlXPtrNewLocationSetNodes() failed')
3157 return xpathObjectRet(ret)
3158
3159 def xpointerNewRange(self, startindex, end, endindex):
3160 """Create a new xmlXPathObjectPtr of type range """
3161 if end is None: end__o = None
3162 else: end__o = end._o
3163 ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex)
3164 if ret is None:raise treeError('xmlXPtrNewRange() failed')
3165 return xpathObjectRet(ret)
3166
3167 def xpointerNewRangeNodes(self, end):
3168 """Create a new xmlXPathObjectPtr of type range using 2 nodes """
3169 if end is None: end__o = None
3170 else: end__o = end._o
3171 ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
3172 if ret is None:raise treeError('xmlXPtrNewRangeNodes() failed')
3173 return xpathObjectRet(ret)
3174
3175class xmlDoc(xmlNode):
3176 def __init__(self, _obj=None):
3177 if checkWrapper(_obj) != 0: raise TypeError('xmlDoc got a wrong wrapper object type')
3178 self._o = _obj
3179 xmlNode.__init__(self, _obj=_obj)
3180
3181 def __repr__(self):
3182 return "<xmlDoc (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
3183
3184 #
3185 # xmlDoc functions from module HTMLparser
3186 #
3187
3188 def htmlAutoCloseTag(self, name, elem):
3189 """The HTML DTD allows a tag to implicitly close other tags.
3190 The list is kept in htmlStartClose array. This function
3191 checks if the element or one of it's children would
3192 autoclose the given tag. """
3193 ret = libxml2mod.htmlAutoCloseTag(self._o, name, elem)
3194 return ret
3195
3196 def htmlIsAutoClosed(self, elem):
3197 """The HTML DTD allows a tag to implicitly close other tags.
3198 The list is kept in htmlStartClose array. This function
3199 checks if a tag is autoclosed by one of it's child """
3200 ret = libxml2mod.htmlIsAutoClosed(self._o, elem)
3201 return ret
3202
3203 #
3204 # xmlDoc functions from module HTMLtree
3205 #
3206
3207 def htmlDocContentDumpFormatOutput(self, buf, encoding, format):
3208 """Dump an HTML document. """
3209 if buf is None: buf__o = None
3210 else: buf__o = buf._o
3211 libxml2mod.htmlDocContentDumpFormatOutput(buf__o, self._o, encoding, format)
3212
3213 def htmlDocContentDumpOutput(self, buf, encoding):
3214 """Dump an HTML document. Formating return/spaces are added. """
3215 if buf is None: buf__o = None
3216 else: buf__o = buf._o
3217 libxml2mod.htmlDocContentDumpOutput(buf__o, self._o, encoding)
3218
3219 def htmlDocDump(self, f):
3220 """Dump an HTML document to an open FILE. """
3221 ret = libxml2mod.htmlDocDump(f, self._o)
3222 return ret
3223
3224 def htmlGetMetaEncoding(self):
3225 """Encoding definition lookup in the Meta tags """
3226 ret = libxml2mod.htmlGetMetaEncoding(self._o)
3227 return ret
3228
3229 def htmlNodeDumpFile(self, out, cur):
3230 """Dump an HTML node, recursive behaviour,children are printed
3231 too, and formatting returns are added. """
3232 if cur is None: cur__o = None
3233 else: cur__o = cur._o
3234 libxml2mod.htmlNodeDumpFile(out, self._o, cur__o)
3235
3236 def htmlNodeDumpFileFormat(self, out, cur, encoding, format):
3237 """Dump an HTML node, recursive behaviour,children are printed
3238 too. TODO: if encoding == None try to save in the doc
3239 encoding """
3240 if cur is None: cur__o = None
3241 else: cur__o = cur._o
3242 ret = libxml2mod.htmlNodeDumpFileFormat(out, self._o, cur__o, encoding, format)
3243 return ret
3244
3245 def htmlNodeDumpFormatOutput(self, buf, cur, encoding, format):
3246 """Dump an HTML node, recursive behaviour,children are printed
3247 too. """
3248 if buf is None: buf__o = None
3249 else: buf__o = buf._o
3250 if cur is None: cur__o = None
3251 else: cur__o = cur._o
3252 libxml2mod.htmlNodeDumpFormatOutput(buf__o, self._o, cur__o, encoding, format)
3253
3254 def htmlNodeDumpOutput(self, buf, cur, encoding):
3255 """Dump an HTML node, recursive behaviour,children are printed
3256 too, and formatting returns/spaces are added. """
3257 if buf is None: buf__o = None
3258 else: buf__o = buf._o
3259 if cur is None: cur__o = None
3260 else: cur__o = cur._o
3261 libxml2mod.htmlNodeDumpOutput(buf__o, self._o, cur__o, encoding)
3262
3263 def htmlSaveFile(self, filename):
3264 """Dump an HTML document to a file. If @filename is "-" the
3265 stdout file is used. """
3266 ret = libxml2mod.htmlSaveFile(filename, self._o)
3267 return ret
3268
3269 def htmlSaveFileEnc(self, filename, encoding):
3270 """Dump an HTML document to a file using a given encoding and
3271 formatting returns/spaces are added. """
3272 ret = libxml2mod.htmlSaveFileEnc(filename, self._o, encoding)
3273 return ret
3274
3275 def htmlSaveFileFormat(self, filename, encoding, format):
3276 """Dump an HTML document to a file using a given encoding. """
3277 ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format)
3278 return ret
3279
3280 def htmlSetMetaEncoding(self, encoding):
3281 """Sets the current encoding in the Meta tags NOTE: this will
3282 not change the document content encoding, just the META
3283 flag associated. """
3284 ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
3285 return ret
3286
3287 #
3288 # xmlDoc functions from module debugXML
3289 #
3290
3291 def debugCheckDocument(self, output):
3292 """Check the document for potential content problems, and
3293 output the errors to @output """
3294 ret = libxml2mod.xmlDebugCheckDocument(output, self._o)
3295 return ret
3296
3297 def debugDumpDocument(self, output):
3298 """Dumps debug information for the document, it's recursive """
3299 libxml2mod.xmlDebugDumpDocument(output, self._o)
3300
3301 def debugDumpDocumentHead(self, output):
3302 """Dumps debug information cncerning the document, not
3303 recursive """
3304 libxml2mod.xmlDebugDumpDocumentHead(output, self._o)
3305
3306 def debugDumpEntities(self, output):
3307 """Dumps debug information for all the entities in use by the
3308 document """
3309 libxml2mod.xmlDebugDumpEntities(output, self._o)
3310
3311 #
3312 # xmlDoc functions from module entities
3313 #
3314
3315 def addDocEntity(self, name, type, ExternalID, SystemID, content):
3316 """Register a new entity for this document. """
3317 ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
3318 if ret is None:raise treeError('xmlAddDocEntity() failed')
3319 __tmp = xmlEntity(_obj=ret)
3320 return __tmp
3321
3322 def addDtdEntity(self, name, type, ExternalID, SystemID, content):
3323 """Register a new entity for this document DTD external subset. """
3324 ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)
3325 if ret is None:raise treeError('xmlAddDtdEntity() failed')
3326 __tmp = xmlEntity(_obj=ret)
3327 return __tmp
3328
3329 def docEntity(self, name):
3330 """Do an entity lookup in the document entity hash table and """
3331 ret = libxml2mod.xmlGetDocEntity(self._o, name)
3332 if ret is None:raise treeError('xmlGetDocEntity() failed')
3333 __tmp = xmlEntity(_obj=ret)
3334 return __tmp
3335
3336 def dtdEntity(self, name):
3337 """Do an entity lookup in the DTD entity hash table and """
3338 ret = libxml2mod.xmlGetDtdEntity(self._o, name)
3339 if ret is None:raise treeError('xmlGetDtdEntity() failed')
3340 __tmp = xmlEntity(_obj=ret)
3341 return __tmp
3342
3343 def encodeEntities(self, input):
3344 """TODO: remove xmlEncodeEntities, once we are not afraid of
3345 breaking binary compatibility People must migrate their
3346 code to xmlEncodeEntitiesReentrant ! This routine will
3347 issue a warning when encountered. """
3348 ret = libxml2mod.xmlEncodeEntities(self._o, input)
3349 return ret
3350
3351 def encodeEntitiesReentrant(self, input):
3352 """Do a global encoding of a string, replacing the predefined
3353 entities and non ASCII values with their entities and
3354 CharRef counterparts. Contrary to xmlEncodeEntities, this
3355 routine is reentrant, and result must be deallocated. """
3356 ret = libxml2mod.xmlEncodeEntitiesReentrant(self._o, input)
3357 return ret
3358
3359 def encodeSpecialChars(self, input):
3360 """Do a global encoding of a string, replacing the predefined
3361 entities this routine is reentrant, and result must be
3362 deallocated. """
3363 ret = libxml2mod.xmlEncodeSpecialChars(self._o, input)
3364 return ret
3365
3366 def newEntity(self, name, type, ExternalID, SystemID, content):
3367 """Create a new entity, this differs from xmlAddDocEntity()
3368 that if the document is None or has no internal subset
3369 defined, then an unlinked entity structure will be
3370 returned, it is then the responsability of the caller to
3371 link it to the document later or free it when not needed
3372 anymore. """
3373 ret = libxml2mod.xmlNewEntity(self._o, name, type, ExternalID, SystemID, content)
3374 if ret is None:raise treeError('xmlNewEntity() failed')
3375 __tmp = xmlEntity(_obj=ret)
3376 return __tmp
3377
3378 def parameterEntity(self, name):
3379 """Do an entity lookup in the internal and external subsets and """
3380 ret = libxml2mod.xmlGetParameterEntity(self._o, name)
3381 if ret is None:raise treeError('xmlGetParameterEntity() failed')
3382 __tmp = xmlEntity(_obj=ret)
3383 return __tmp
3384
3385 #
3386 # xmlDoc functions from module relaxng
3387 #
3388
3389 def relaxNGNewDocParserCtxt(self):
3390 """Create an XML RelaxNGs parser context for that document.
3391 Note: since the process of compiling a RelaxNG schemas
3392 modifies the document, the @doc parameter is duplicated
3393 internally. """
3394 ret = libxml2mod.xmlRelaxNGNewDocParserCtxt(self._o)
3395 if ret is None:raise parserError('xmlRelaxNGNewDocParserCtxt() failed')
3396 __tmp = relaxNgParserCtxt(_obj=ret)
3397 return __tmp
3398
3399 def relaxNGValidateDoc(self, ctxt):
3400 """Validate a document tree in memory. """
3401 if ctxt is None: ctxt__o = None
3402 else: ctxt__o = ctxt._o
3403 ret = libxml2mod.xmlRelaxNGValidateDoc(ctxt__o, self._o)
3404 return ret
3405
3406 def relaxNGValidateFullElement(self, ctxt, elem):
3407 """Validate a full subtree when
3408 xmlRelaxNGValidatePushElement() returned 0 and the content
3409 of the node has been expanded. """
3410 if ctxt is None: ctxt__o = None
3411 else: ctxt__o = ctxt._o
3412 if elem is None: elem__o = None
3413 else: elem__o = elem._o
3414 ret = libxml2mod.xmlRelaxNGValidateFullElement(ctxt__o, self._o, elem__o)
3415 return ret
3416
3417 def relaxNGValidatePopElement(self, ctxt, elem):
3418 """Pop the element end from the RelaxNG validation stack. """
3419 if ctxt is None: ctxt__o = None
3420 else: ctxt__o = ctxt._o
3421 if elem is None: elem__o = None
3422 else: elem__o = elem._o
3423 ret = libxml2mod.xmlRelaxNGValidatePopElement(ctxt__o, self._o, elem__o)
3424 return ret
3425
3426 def relaxNGValidatePushElement(self, ctxt, elem):
3427 """Push a new element start on the RelaxNG validation stack. """
3428 if ctxt is None: ctxt__o = None
3429 else: ctxt__o = ctxt._o
3430 if elem is None: elem__o = None
3431 else: elem__o = elem._o
3432 ret = libxml2mod.xmlRelaxNGValidatePushElement(ctxt__o, self._o, elem__o)
3433 return ret
3434
3435 #
3436 # xmlDoc functions from module tree
3437 #
3438
3439 def copyDoc(self, recursive):
3440 """Do a copy of the document info. If recursive, the content
3441 tree will be copied too as well as DTD, namespaces and
3442 entities. """
3443 ret = libxml2mod.xmlCopyDoc(self._o, recursive)
3444 if ret is None:raise treeError('xmlCopyDoc() failed')
3445 __tmp = xmlDoc(_obj=ret)
3446 return __tmp
3447
3448 def copyNode(self, node, extended):
3449 """Do a copy of the node to a given document. """
3450 if node is None: node__o = None
3451 else: node__o = node._o
3452 ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended)
3453 if ret is None:raise treeError('xmlDocCopyNode() failed')
3454 __tmp = xmlNode(_obj=ret)
3455 return __tmp
3456
3457 def copyNodeList(self, node):
3458 """Do a recursive copy of the node list. """
3459 if node is None: node__o = None
3460 else: node__o = node._o
3461 ret = libxml2mod.xmlDocCopyNodeList(self._o, node__o)
3462 if ret is None:raise treeError('xmlDocCopyNodeList() failed')
3463 __tmp = xmlNode(_obj=ret)
3464 return __tmp
3465
3466 def createIntSubset(self, name, ExternalID, SystemID):
3467 """Create the internal subset of a document """
3468 ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID)
3469 if ret is None:raise treeError('xmlCreateIntSubset() failed')
3470 __tmp = xmlDtd(_obj=ret)
3471 return __tmp
3472
3473 def docCompressMode(self):
3474 """get the compression ratio for a document, ZLIB based """
3475 ret = libxml2mod.xmlGetDocCompressMode(self._o)
3476 return ret
3477
3478 def dump(self, f):
3479 """Dump an XML document to an open FILE. """
3480 ret = libxml2mod.xmlDocDump(f, self._o)
3481 return ret
3482
3483 def elemDump(self, f, cur):
3484 """Dump an XML/HTML node, recursive behaviour, children are
3485 printed too. """
3486 if cur is None: cur__o = None
3487 else: cur__o = cur._o
3488 libxml2mod.xmlElemDump(f, self._o, cur__o)
3489
3490 def formatDump(self, f, format):
3491 """Dump an XML document to an open FILE. """
3492 ret = libxml2mod.xmlDocFormatDump(f, self._o, format)
3493 return ret
3494
3495 def freeDoc(self):
3496 """Free up all the structures used by a document, tree
3497 included. """
3498 libxml2mod.xmlFreeDoc(self._o)
3499
3500 def getRootElement(self):
3501 """Get the root element of the document (doc->children is a
3502 list containing possibly comments, PIs, etc ...). """
3503 ret = libxml2mod.xmlDocGetRootElement(self._o)
3504 if ret is None:raise treeError('xmlDocGetRootElement() failed')
3505 __tmp = xmlNode(_obj=ret)
3506 return __tmp
3507
3508 def intSubset(self):
3509 """Get the internal subset of a document """
3510 ret = libxml2mod.xmlGetIntSubset(self._o)
3511 if ret is None:raise treeError('xmlGetIntSubset() failed')
3512 __tmp = xmlDtd(_obj=ret)
3513 return __tmp
3514
3515 def newCDataBlock(self, content, len):
3516 """Creation of a new node containing a CDATA block. """
3517 ret = libxml2mod.xmlNewCDataBlock(self._o, content, len)
3518 if ret is None:raise treeError('xmlNewCDataBlock() failed')
3519 __tmp = xmlNode(_obj=ret)
3520 return __tmp
3521
3522 def newCharRef(self, name):
3523 """Creation of a new character reference node. """
3524 ret = libxml2mod.xmlNewCharRef(self._o, name)
3525 if ret is None:raise treeError('xmlNewCharRef() failed')
3526 __tmp = xmlNode(_obj=ret)
3527 return __tmp
3528
3529 def newDocComment(self, content):
3530 """Creation of a new node containing a comment within a
3531 document. """
3532 ret = libxml2mod.xmlNewDocComment(self._o, content)
3533 if ret is None:raise treeError('xmlNewDocComment() failed')
3534 __tmp = xmlNode(_obj=ret)
3535 return __tmp
3536
3537 def newDocFragment(self):
3538 """Creation of a new Fragment node. """
3539 ret = libxml2mod.xmlNewDocFragment(self._o)
3540 if ret is None:raise treeError('xmlNewDocFragment() failed')
3541 __tmp = xmlNode(_obj=ret)
3542 return __tmp
3543
3544 def newDocNode(self, ns, name, content):
3545 """Creation of a new node element within a document. @ns and
3546 @content are optional (None). NOTE: @content is supposed to
3547 be a piece of XML CDATA, so it allow entities references,
3548 but XML special chars need to be escaped first by using
3549 xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
3550 don't need entities support. """
3551 if ns is None: ns__o = None
3552 else: ns__o = ns._o
3553 ret = libxml2mod.xmlNewDocNode(self._o, ns__o, name, content)
3554 if ret is None:raise treeError('xmlNewDocNode() failed')
3555 __tmp = xmlNode(_obj=ret)
3556 return __tmp
3557
3558 def newDocNodeEatName(self, ns, name, content):
3559 """Creation of a new node element within a document. @ns and
3560 @content are optional (None). NOTE: @content is supposed to
3561 be a piece of XML CDATA, so it allow entities references,
3562 but XML special chars need to be escaped first by using
3563 xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
3564 don't need entities support. """
3565 if ns is None: ns__o = None
3566 else: ns__o = ns._o
3567 ret = libxml2mod.xmlNewDocNodeEatName(self._o, ns__o, name, content)
3568 if ret is None:raise treeError('xmlNewDocNodeEatName() failed')
3569 __tmp = xmlNode(_obj=ret)
3570 return __tmp
3571
3572 def newDocPI(self, name, content):
3573 """Creation of a processing instruction element. """
3574 ret = libxml2mod.xmlNewDocPI(self._o, name, content)
3575 if ret is None:raise treeError('xmlNewDocPI() failed')
3576 __tmp = xmlNode(_obj=ret)
3577 return __tmp
3578
3579 def newDocProp(self, name, value):
3580 """Create a new property carried by a document. """
3581 ret = libxml2mod.xmlNewDocProp(self._o, name, value)
3582 if ret is None:raise treeError('xmlNewDocProp() failed')
3583 __tmp = xmlAttr(_obj=ret)
3584 return __tmp
3585
3586 def newDocRawNode(self, ns, name, content):
3587 """Creation of a new node element within a document. @ns and
3588 @content are optional (None). """
3589 if ns is None: ns__o = None
3590 else: ns__o = ns._o
3591 ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content)
3592 if ret is None:raise treeError('xmlNewDocRawNode() failed')
3593 __tmp = xmlNode(_obj=ret)
3594 return __tmp
3595
3596 def newDocText(self, content):
3597 """Creation of a new text node within a document. """
3598 ret = libxml2mod.xmlNewDocText(self._o, content)
3599 if ret is None:raise treeError('xmlNewDocText() failed')
3600 __tmp = xmlNode(_obj=ret)
3601 return __tmp
3602
3603 def newDocTextLen(self, content, len):
3604 """Creation of a new text node with an extra content length
3605 parameter. The text node pertain to a given document. """
3606 ret = libxml2mod.xmlNewDocTextLen(self._o, content, len)
3607 if ret is None:raise treeError('xmlNewDocTextLen() failed')
3608 __tmp = xmlNode(_obj=ret)
3609 return __tmp
3610
3611 def newDtd(self, name, ExternalID, SystemID):
3612 """Creation of a new DTD for the external subset. To create an
3613 internal subset, use xmlCreateIntSubset(). """
3614 ret = libxml2mod.xmlNewDtd(self._o, name, ExternalID, SystemID)
3615 if ret is None:raise treeError('xmlNewDtd() failed')
3616 __tmp = xmlDtd(_obj=ret)
3617 return __tmp
3618
3619 def newGlobalNs(self, href, prefix):
3620 """Creation of a Namespace, the old way using PI and without
3621 scoping DEPRECATED !!! """
3622 ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix)
3623 if ret is None:raise treeError('xmlNewGlobalNs() failed')
3624 __tmp = xmlNs(_obj=ret)
3625 return __tmp
3626
3627 def newReference(self, name):
3628 """Creation of a new reference node. """
3629 ret = libxml2mod.xmlNewReference(self._o, name)
3630 if ret is None:raise treeError('xmlNewReference() failed')
3631 __tmp = xmlNode(_obj=ret)
3632 return __tmp
3633
3634 def nodeDumpOutput(self, buf, cur, level, format, encoding):
3635 """Dump an XML node, recursive behaviour, children are printed
3636 too. Note that @format = 1 provide node indenting only if
3637 xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
3638 called """
3639 if buf is None: buf__o = None
3640 else: buf__o = buf._o
3641 if cur is None: cur__o = None
3642 else: cur__o = cur._o
3643 libxml2mod.xmlNodeDumpOutput(buf__o, self._o, cur__o, level, format, encoding)
3644
3645 def nodeGetBase(self, cur):
3646 """Searches for the BASE URL. The code should work on both XML
3647 and HTML document even if base mechanisms are completely
3648 different. It returns the base as defined in RFC 2396
3649 sections 5.1.1. Base URI within Document Content and 5.1.2.
3650 Base URI from the Encapsulating Entity However it does not
3651 return the document base (5.1.3), use doc->URL in this case """
3652 if cur is None: cur__o = None
3653 else: cur__o = cur._o
3654 ret = libxml2mod.xmlNodeGetBase(self._o, cur__o)
3655 return ret
3656
3657 def nodeListGetRawString(self, list, inLine):
3658 """Builds the string equivalent to the text contained in the
3659 Node list made of TEXTs and ENTITY_REFs, contrary to
3660 xmlNodeListGetString() this function doesn't do any
3661 character encoding handling. """
3662 if list is None: list__o = None
3663 else: list__o = list._o
3664 ret = libxml2mod.xmlNodeListGetRawString(self._o, list__o, inLine)
3665 return ret
3666
3667 def nodeListGetString(self, list, inLine):
3668 """Build the string equivalent to the text contained in the
3669 Node list made of TEXTs and ENTITY_REFs """
3670 if list is None: list__o = None
3671 else: list__o = list._o
3672 ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
3673 return ret
3674
3675 def reconciliateNs(self, tree):
3676 """This function checks that all the namespaces declared
3677 within the given tree are properly declared. This is needed
3678 for example after Copy or Cut and then paste operations.
3679 The subtree may still hold pointers to namespace
3680 declarations outside the subtree or invalid/masked. As much
3681 as possible the function try to reuse the existing
3682 namespaces found in the new environment. If not possible
3683 the new namespaces are redeclared on @tree at the top of
3684 the given subtree. """
3685 if tree is None: tree__o = None
3686 else: tree__o = tree._o
3687 ret = libxml2mod.xmlReconciliateNs(self._o, tree__o)
3688 return ret
3689
3690 def saveFile(self, filename):
3691 """Dump an XML document to a file. Will use compression if
3692 compiled in and enabled. If @filename is "-" the stdout
3693 file is used. """
3694 ret = libxml2mod.xmlSaveFile(filename, self._o)
3695 return ret
3696
3697 def saveFileEnc(self, filename, encoding):
3698 """Dump an XML document, converting it to the given encoding """
3699 ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding)
3700 return ret
3701
3702 def saveFileTo(self, buf, encoding):
3703 """Dump an XML document to an I/O buffer. Warning ! This call
3704 xmlOutputBufferClose() on buf which is not available after
3705 this call. """
3706 if buf is None: buf__o = None
3707 else: buf__o = buf._o
3708 ret = libxml2mod.xmlSaveFileTo(buf__o, self._o, encoding)
3709 return ret
3710
3711 def saveFormatFile(self, filename, format):
3712 """Dump an XML document to a file. Will use compression if
3713 compiled in and enabled. If @filename is "-" the stdout
3714 file is used. If @format is set then the document will be
3715 indented on output. Note that @format = 1 provide node
3716 indenting only if xmlIndentTreeOutput = 1 or
3717 xmlKeepBlanksDefault(0) was called """
3718 ret = libxml2mod.xmlSaveFormatFile(filename, self._o, format)
3719 return ret
3720
3721 def saveFormatFileEnc(self, filename, encoding, format):
3722 """Dump an XML document to a file or an URL. """
3723 ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format)
3724 return ret
3725
3726 def saveFormatFileTo(self, buf, encoding, format):
3727 """Dump an XML document to an I/O buffer. Warning ! This call
3728 xmlOutputBufferClose() on buf which is not available after
3729 this call. """
3730 if buf is None: buf__o = None
3731 else: buf__o = buf._o
3732 ret = libxml2mod.xmlSaveFormatFileTo(buf__o, self._o, encoding, format)
3733 return ret
3734
3735 def searchNs(self, node, nameSpace):
3736 """Search a Ns registered under a given name space for a
3737 document. recurse on the parents until it finds the defined
3738 namespace or return None otherwise. @nameSpace can be None,
3739 this is a search for the default namespace. We don't allow
3740 to cross entities boundaries. If you don't declare the
3741 namespace within those you will be in troubles !!! A
3742 warning is generated to cover this case. """
3743 if node is None: node__o = None
3744 else: node__o = node._o
3745 ret = libxml2mod.xmlSearchNs(self._o, node__o, nameSpace)
3746 if ret is None:raise treeError('xmlSearchNs() failed')
3747 __tmp = xmlNs(_obj=ret)
3748 return __tmp
3749
3750 def searchNsByHref(self, node, href):
3751 """Search a Ns aliasing a given URI. Recurse on the parents
3752 until it finds the defined namespace or return None
3753 otherwise. """
3754 if node is None: node__o = None
3755 else: node__o = node._o
3756 ret = libxml2mod.xmlSearchNsByHref(self._o, node__o, href)
3757 if ret is None:raise treeError('xmlSearchNsByHref() failed')
3758 __tmp = xmlNs(_obj=ret)
3759 return __tmp
3760
3761 def setDocCompressMode(self, mode):
3762 """set the compression ratio for a document, ZLIB based
3763 Correct values: 0 (uncompressed) to 9 (max compression) """
3764 libxml2mod.xmlSetDocCompressMode(self._o, mode)
3765
3766 def setListDoc(self, list):
3767 """update all nodes in the list to point to the right document """
3768 if list is None: list__o = None
3769 else: list__o = list._o
3770 libxml2mod.xmlSetListDoc(list__o, self._o)
3771
3772 def setRootElement(self, root):
3773 """Set the root element of the document (doc->children is a
3774 list containing possibly comments, PIs, etc ...). """
3775 if root is None: root__o = None
3776 else: root__o = root._o
3777 ret = libxml2mod.xmlDocSetRootElement(self._o, root__o)
3778 if ret is None:return None
3779 __tmp = xmlNode(_obj=ret)
3780 return __tmp
3781
3782 def setTreeDoc(self, tree):
3783 """update all nodes under the tree to point to the right
3784 document """
3785 if tree is None: tree__o = None
3786 else: tree__o = tree._o
3787 libxml2mod.xmlSetTreeDoc(tree__o, self._o)
3788
3789 def stringGetNodeList(self, value):
3790 """Parse the value string and build the node list associated.
3791 Should produce a flat tree with only TEXTs and ENTITY_REFs. """
3792 ret = libxml2mod.xmlStringGetNodeList(self._o, value)
3793 if ret is None:raise treeError('xmlStringGetNodeList() failed')
3794 __tmp = xmlNode(_obj=ret)
3795 return __tmp
3796
3797 def stringLenGetNodeList(self, value, len):
3798 """Parse the value string and build the node list associated.
3799 Should produce a flat tree with only TEXTs and ENTITY_REFs. """
3800 ret = libxml2mod.xmlStringLenGetNodeList(self._o, value, len)
3801 if ret is None:raise treeError('xmlStringLenGetNodeList() failed')
3802 __tmp = xmlNode(_obj=ret)
3803 return __tmp
3804
3805 #
3806 # xmlDoc functions from module valid
3807 #
3808
3809 def ID(self, ID):
3810 """Search the attribute declaring the given ID """
3811 ret = libxml2mod.xmlGetID(self._o, ID)
3812 if ret is None:raise treeError('xmlGetID() failed')
3813 __tmp = xmlAttr(_obj=ret)
3814 return __tmp
3815
3816 def isID(self, elem, attr):
3817 """Determine whether an attribute is of type ID. In case we
3818 have DTD(s) then this is done if DTD loading has been
3819 requested. In the case of HTML documents parsed with the
3820 HTML parser, then ID detection is done systematically. """
3821 if elem is None: elem__o = None
3822 else: elem__o = elem._o
3823 if attr is None: attr__o = None
3824 else: attr__o = attr._o
3825 ret = libxml2mod.xmlIsID(self._o, elem__o, attr__o)
3826 return ret
3827
3828 def isMixedElement(self, name):
3829 """Search in the DtDs whether an element accept Mixed content
3830 (or ANY) basically if it is supposed to accept text childs """
3831 ret = libxml2mod.xmlIsMixedElement(self._o, name)
3832 return ret
3833
3834 def isRef(self, elem, attr):
3835 """Determine whether an attribute is of type Ref. In case we
3836 have DTD(s) then this is simple, otherwise we use an
3837 heuristic: name Ref (upper or lowercase). """
3838 if elem is None: elem__o = None
3839 else: elem__o = elem._o
3840 if attr is None: attr__o = None
3841 else: attr__o = attr._o
3842 ret = libxml2mod.xmlIsRef(self._o, elem__o, attr__o)
3843 return ret
3844
3845 def removeID(self, attr):
3846 """Remove the given attribute from the ID table maintained
3847 internally. """
3848 if attr is None: attr__o = None
3849 else: attr__o = attr._o
3850 ret = libxml2mod.xmlRemoveID(self._o, attr__o)
3851 return ret
3852
3853 def removeRef(self, attr):
3854 """Remove the given attribute from the Ref table maintained
3855 internally. """
3856 if attr is None: attr__o = None
3857 else: attr__o = attr._o
3858 ret = libxml2mod.xmlRemoveRef(self._o, attr__o)
3859 return ret
3860
3861 def validCtxtNormalizeAttributeValue(self, ctxt, elem, name, value):
3862 """Does the validation related extra step of the normalization
3863 of attribute values: If the declared value is not CDATA,
3864 then the XML processor must further process the normalized
3865 attribute value by discarding any leading and trailing
3866 space (#x20) characters, and by replacing sequences of
3867 space (#x20) characters by single space (#x20) character.
3868 Also check VC: Standalone Document Declaration in P32, and
3869 update ctxt->valid accordingly """
3870 if ctxt is None: ctxt__o = None
3871 else: ctxt__o = ctxt._o
3872 if elem is None: elem__o = None
3873 else: elem__o = elem._o
3874 ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(ctxt__o, self._o, elem__o, name, value)
3875 return ret
3876
3877 def validNormalizeAttributeValue(self, elem, name, value):
3878 """Does the validation related extra step of the normalization
3879 of attribute values: If the declared value is not CDATA,
3880 then the XML processor must further process the normalized
3881 attribute value by discarding any leading and trailing
3882 space (#x20) characters, and by replacing sequences of
3883 space (#x20) characters by single space (#x20) character. """
3884 if elem is None: elem__o = None
3885 else: elem__o = elem._o
3886 ret = libxml2mod.xmlValidNormalizeAttributeValue(self._o, elem__o, name, value)
3887 return ret
3888
3889 def validateDocument(self, ctxt):
3890 """Try to validate the document instance basically it does
3891 the all the checks described by the XML Rec i.e. validates
3892 the internal and external subset (if present) and validate
3893 the document tree. """
3894 if ctxt is None: ctxt__o = None
3895 else: ctxt__o = ctxt._o
3896 ret = libxml2mod.xmlValidateDocument(ctxt__o, self._o)
3897 return ret
3898
3899 def validateDocumentFinal(self, ctxt):
3900 """Does the final step for the document validation once all
3901 the incremental validation steps have been completed
3902 basically it does the following checks described by the XML
3903 Rec Check all the IDREF/IDREFS attributes definition for
3904 validity """
3905 if ctxt is None: ctxt__o = None
3906 else: ctxt__o = ctxt._o
3907 ret = libxml2mod.xmlValidateDocumentFinal(ctxt__o, self._o)
3908 return ret
3909
3910 def validateDtd(self, ctxt, dtd):
3911 """Try to validate the document against the dtd instance
3912 Basically it does check all the definitions in the DtD.
3913 Note the the internal subset (if present) is de-coupled
3914 (i.e. not used), which could give problems if ID or IDREF
3915 is present. """
3916 if ctxt is None: ctxt__o = None
3917 else: ctxt__o = ctxt._o
3918 if dtd is None: dtd__o = None
3919 else: dtd__o = dtd._o
3920 ret = libxml2mod.xmlValidateDtd(ctxt__o, self._o, dtd__o)
3921 return ret
3922
3923 def validateDtdFinal(self, ctxt):
3924 """Does the final step for the dtds validation once all the
3925 subsets have been parsed basically it does the following
3926 checks described by the XML Rec - check that ENTITY and
3927 ENTITIES type attributes default or possible values matches
3928 one of the defined entities. - check that NOTATION type
3929 attributes default or possible values matches one of the
3930 defined notations. """
3931 if ctxt is None: ctxt__o = None
3932 else: ctxt__o = ctxt._o
3933 ret = libxml2mod.xmlValidateDtdFinal(ctxt__o, self._o)
3934 return ret
3935
3936 def validateElement(self, ctxt, elem):
3937 """Try to validate the subtree under an element """
3938 if ctxt is None: ctxt__o = None
3939 else: ctxt__o = ctxt._o
3940 if elem is None: elem__o = None
3941 else: elem__o = elem._o
3942 ret = libxml2mod.xmlValidateElement(ctxt__o, self._o, elem__o)
3943 return ret
3944
3945 def validateNotationUse(self, ctxt, notationName):
3946 """Validate that the given name match a notation declaration.
3947 - [ VC: Notation Declared ] """
3948 if ctxt is None: ctxt__o = None
3949 else: ctxt__o = ctxt._o
3950 ret = libxml2mod.xmlValidateNotationUse(ctxt__o, self._o, notationName)
3951 return ret
3952
3953 def validateOneAttribute(self, ctxt, elem, attr, value):
3954 """Try to validate a single attribute for an element basically
3955 it does the following checks as described by the XML-1.0
3956 recommendation: - [ VC: Attribute Value Type ] - [ VC:
3957 Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
3958 Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
3959 Name ] - [ VC: Notation Attributes ] The ID/IDREF
3960 uniqueness and matching are done separately """
3961 if ctxt is None: ctxt__o = None
3962 else: ctxt__o = ctxt._o
3963 if elem is None: elem__o = None
3964 else: elem__o = elem._o
3965 if attr is None: attr__o = None
3966 else: attr__o = attr._o
3967 ret = libxml2mod.xmlValidateOneAttribute(ctxt__o, self._o, elem__o, attr__o, value)
3968 return ret
3969
3970 def validateOneElement(self, ctxt, elem):
3971 """Try to validate a single element and it's attributes,
3972 basically it does the following checks as described by the
3973 XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
3974 Required Attribute ] Then call xmlValidateOneAttribute()
3975 for each attribute present. The ID/IDREF checkings are
3976 done separately """
3977 if ctxt is None: ctxt__o = None
3978 else: ctxt__o = ctxt._o
3979 if elem is None: elem__o = None
3980 else: elem__o = elem._o
3981 ret = libxml2mod.xmlValidateOneElement(ctxt__o, self._o, elem__o)
3982 return ret
3983
3984 def validateOneNamespace(self, ctxt, elem, prefix, ns, value):
3985 """Try to validate a single namespace declaration for an
3986 element basically it does the following checks as described
3987 by the XML-1.0 recommendation: - [ VC: Attribute Value Type
3988 ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
3989 [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
3990 Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF
3991 uniqueness and matching are done separately """
3992 if ctxt is None: ctxt__o = None
3993 else: ctxt__o = ctxt._o
3994 if elem is None: elem__o = None
3995 else: elem__o = elem._o
3996 if ns is None: ns__o = None
3997 else: ns__o = ns._o
3998 ret = libxml2mod.xmlValidateOneNamespace(ctxt__o, self._o, elem__o, prefix, ns__o, value)
3999 return ret
4000
4001 def validatePopElement(self, ctxt, elem, qname):
4002 """Pop the element end from the validation stack. """
4003 if ctxt is None: ctxt__o = None
4004 else: ctxt__o = ctxt._o
4005 if elem is None: elem__o = None
4006 else: elem__o = elem._o
4007 ret = libxml2mod.xmlValidatePopElement(ctxt__o, self._o, elem__o, qname)
4008 return ret
4009
4010 def validatePushElement(self, ctxt, elem, qname):
4011 """Push a new element start on the validation stack. """
4012 if ctxt is None: ctxt__o = None
4013 else: ctxt__o = ctxt._o
4014 if elem is None: elem__o = None
4015 else: elem__o = elem._o
4016 ret = libxml2mod.xmlValidatePushElement(ctxt__o, self._o, elem__o, qname)
4017 return ret
4018
4019 def validateRoot(self, ctxt):
4020 """Try to validate a the root element basically it does the
4021 following check as described by the XML-1.0 recommendation:
4022 - [ VC: Root Element Type ] it doesn't try to recurse or
4023 apply other check to the element """
4024 if ctxt is None: ctxt__o = None
4025 else: ctxt__o = ctxt._o
4026 ret = libxml2mod.xmlValidateRoot(ctxt__o, self._o)
4027 return ret
4028
4029 #
4030 # xmlDoc functions from module xinclude
4031 #
4032
4033 def xincludeProcess(self):
4034 """Implement the XInclude substitution on the XML document @doc """
4035 ret = libxml2mod.xmlXIncludeProcess(self._o)
4036 return ret
4037
4038 def xincludeProcessFlags(self, flags):
4039 """Implement the XInclude substitution on the XML document @doc """
4040 ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
4041 return ret
4042
4043 #
4044 # xmlDoc functions from module xmlreader
4045 #
4046
4047 def NewWalker(self, reader):
4048 """Setup an xmltextReader to parse a preparsed XML document.
4049 This reuses the existing @reader xmlTextReader. """
4050 if reader is None: reader__o = None
4051 else: reader__o = reader._o
4052 ret = libxml2mod.xmlReaderNewWalker(reader__o, self._o)
4053 return ret
4054
4055 def readerWalker(self):
4056 """Create an xmltextReader for a preparsed document. """
4057 ret = libxml2mod.xmlReaderWalker(self._o)
4058 if ret is None:raise treeError('xmlReaderWalker() failed')
4059 __tmp = xmlTextReader(_obj=ret)
4060 return __tmp
4061
4062 #
4063 # xmlDoc functions from module xmlschemas
4064 #
4065
4066 def schemaNewDocParserCtxt(self):
4067 """Create an XML Schemas parse context for that document. NB.
4068 The document may be modified during the parsing process. """
4069 ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o)
4070 if ret is None:raise parserError('xmlSchemaNewDocParserCtxt() failed')
4071 __tmp = SchemaParserCtxt(_obj=ret)
4072 return __tmp
4073
4074 def schemaValidateDoc(self, ctxt):
4075 """Validate a document tree in memory. """
4076 if ctxt is None: ctxt__o = None
4077 else: ctxt__o = ctxt._o
4078 ret = libxml2mod.xmlSchemaValidateDoc(ctxt__o, self._o)
4079 return ret
4080
4081 #
4082 # xmlDoc functions from module xpath
4083 #
4084
4085 def xpathNewContext(self):
4086 """Create a new xmlXPathContext """
4087 ret = libxml2mod.xmlXPathNewContext(self._o)
4088 if ret is None:raise xpathError('xmlXPathNewContext() failed')
4089 __tmp = xpathContext(_obj=ret)
4090 return __tmp
4091
4092 def xpathOrderDocElems(self):
4093 """Call this routine to speed up XPath computation on static
4094 documents. This stamps all the element nodes with the
4095 document order Like for line information, the order is kept
4096 in the element->content field, the value stored is actually
4097 - the node number (starting at -1) to be able to
4098 differentiate from line numbers. """
4099 ret = libxml2mod.xmlXPathOrderDocElems(self._o)
4100 return ret
4101
4102 #
4103 # xmlDoc functions from module xpointer
4104 #
4105
4106 def xpointerNewContext(self, here, origin):
4107 """Create a new XPointer context """
4108 if here is None: here__o = None
4109 else: here__o = here._o
4110 if origin is None: origin__o = None
4111 else: origin__o = origin._o
4112 ret = libxml2mod.xmlXPtrNewContext(self._o, here__o, origin__o)
4113 if ret is None:raise treeError('xmlXPtrNewContext() failed')
4114 __tmp = xpathContext(_obj=ret)
4115 return __tmp
4116
4117class parserCtxt(parserCtxtCore):
4118 def __init__(self, _obj=None):
4119 self._o = _obj
4120 parserCtxtCore.__init__(self, _obj=_obj)
4121
4122 def __del__(self):
4123 if self._o != None:
4124 libxml2mod.xmlFreeParserCtxt(self._o)
4125 self._o = None
4126
4127 # accessors for parserCtxt
4128 def doc(self):
4129 """Get the document tree from a parser context. """
4130 ret = libxml2mod.xmlParserGetDoc(self._o)
4131 if ret is None:raise parserError('xmlParserGetDoc() failed')
4132 __tmp = xmlDoc(_obj=ret)
4133 return __tmp
4134
4135 def isValid(self):
4136 """Get the validity information from a parser context. """
4137 ret = libxml2mod.xmlParserGetIsValid(self._o)
4138 return ret
4139
4140 def lineNumbers(self, linenumbers):
4141 """Switch on the generation of line number for elements nodes. """
4142 libxml2mod.xmlParserSetLineNumbers(self._o, linenumbers)
4143
4144 def loadSubset(self, loadsubset):
4145 """Switch the parser to load the DTD without validating. """
4146 libxml2mod.xmlParserSetLoadSubset(self._o, loadsubset)
4147
4148 def pedantic(self, pedantic):
4149 """Switch the parser to be pedantic. """
4150 libxml2mod.xmlParserSetPedantic(self._o, pedantic)
4151
4152 def replaceEntities(self, replaceEntities):
4153 """Switch the parser to replace entities. """
4154 libxml2mod.xmlParserSetReplaceEntities(self._o, replaceEntities)
4155
4156 def validate(self, validate):
4157 """Switch the parser to validation mode. """
4158 libxml2mod.xmlParserSetValidate(self._o, validate)
4159
4160 def wellFormed(self):
4161 """Get the well formed information from a parser context. """
4162 ret = libxml2mod.xmlParserGetWellFormed(self._o)
4163 return ret
4164
4165 #
4166 # parserCtxt functions from module HTMLparser
4167 #
4168
4169 def htmlCtxtReadDoc(self, cur, URL, encoding, options):
4170 """parse an XML in-memory document and build a tree. This
4171 reuses the existing @ctxt parser context """
4172 ret = libxml2mod.htmlCtxtReadDoc(self._o, cur, URL, encoding, options)
4173 if ret is None:raise treeError('htmlCtxtReadDoc() failed')
4174 __tmp = xmlDoc(_obj=ret)
4175 return __tmp
4176
4177 def htmlCtxtReadFd(self, fd, URL, encoding, options):
4178 """parse an XML from a file descriptor and build a tree. This
4179 reuses the existing @ctxt parser context """
4180 ret = libxml2mod.htmlCtxtReadFd(self._o, fd, URL, encoding, options)
4181 if ret is None:raise treeError('htmlCtxtReadFd() failed')
4182 __tmp = xmlDoc(_obj=ret)
4183 return __tmp
4184
4185 def htmlCtxtReadFile(self, filename, encoding, options):
4186 """parse an XML file from the filesystem or the network. This
4187 reuses the existing @ctxt parser context """
4188 ret = libxml2mod.htmlCtxtReadFile(self._o, filename, encoding, options)
4189 if ret is None:raise treeError('htmlCtxtReadFile() failed')
4190 __tmp = xmlDoc(_obj=ret)
4191 return __tmp
4192
4193 def htmlCtxtReadMemory(self, buffer, size, URL, encoding, options):
4194 """parse an XML in-memory document and build a tree. This
4195 reuses the existing @ctxt parser context """
4196 ret = libxml2mod.htmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
4197 if ret is None:raise treeError('htmlCtxtReadMemory() failed')
4198 __tmp = xmlDoc(_obj=ret)
4199 return __tmp
4200
4201 def htmlCtxtReset(self):
4202 """Reset a parser context """
4203 libxml2mod.htmlCtxtReset(self._o)
4204
4205 def htmlCtxtUseOptions(self, options):
4206 """Applies the options to the parser context """
4207 ret = libxml2mod.htmlCtxtUseOptions(self._o, options)
4208 return ret
4209
4210 def htmlFreeParserCtxt(self):
4211 """Free all the memory used by a parser context. However the
4212 parsed document in ctxt->myDoc is not freed. """
4213 libxml2mod.htmlFreeParserCtxt(self._o)
4214
4215 def htmlParseCharRef(self):
4216 """parse Reference declarations [66] CharRef ::= '&#' [0-9]+
4217 ';' | '&#x' [0-9a-fA-F]+ ';' """
4218 ret = libxml2mod.htmlParseCharRef(self._o)
4219 return ret
4220
4221 def htmlParseChunk(self, chunk, size, terminate):
4222 """Parse a Chunk of memory """
4223 ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate)
4224 return ret
4225
4226 def htmlParseDocument(self):
4227 """parse an HTML document (and build a tree if using the
4228 standard SAX interface). """
4229 ret = libxml2mod.htmlParseDocument(self._o)
4230 return ret
4231
4232 def htmlParseElement(self):
4233 """parse an HTML element, this is highly recursive this is
4234 kept for compatibility with previous code versions [39]
4235 element ::= EmptyElemTag | STag content ETag [41]
4236 Attribute ::= Name Eq AttValue """
4237 libxml2mod.htmlParseElement(self._o)
4238
4239 #
4240 # parserCtxt functions from module parser
4241 #
4242
4243 def byteConsumed(self):
4244 """This function provides the current index of the parser
4245 relative to the start of the current entity. This function
4246 is computed in bytes from the beginning starting at zero
4247 and finishing at the size in byte of the file if parsing a
4248 file. The function is of constant cost if the input is
4249 UTF-8 but can be costly if run on non-UTF-8 input. """
4250 ret = libxml2mod.xmlByteConsumed(self._o)
4251 return ret
4252
4253 def clearParserCtxt(self):
4254 """Clear (release owned resources) and reinitialize a parser
4255 context """
4256 libxml2mod.xmlClearParserCtxt(self._o)
4257
4258 def ctxtReadDoc(self, cur, URL, encoding, options):
4259 """parse an XML in-memory document and build a tree. This
4260 reuses the existing @ctxt parser context """
4261 ret = libxml2mod.xmlCtxtReadDoc(self._o, cur, URL, encoding, options)
4262 if ret is None:raise treeError('xmlCtxtReadDoc() failed')
4263 __tmp = xmlDoc(_obj=ret)
4264 return __tmp
4265
4266 def ctxtReadFd(self, fd, URL, encoding, options):
4267 """parse an XML from a file descriptor and build a tree. This
4268 reuses the existing @ctxt parser context NOTE that the file
4269 descriptor will not be closed when the reader is closed or
4270 reset. """
4271 ret = libxml2mod.xmlCtxtReadFd(self._o, fd, URL, encoding, options)
4272 if ret is None:raise treeError('xmlCtxtReadFd() failed')
4273 __tmp = xmlDoc(_obj=ret)
4274 return __tmp
4275
4276 def ctxtReadFile(self, filename, encoding, options):
4277 """parse an XML file from the filesystem or the network. This
4278 reuses the existing @ctxt parser context """
4279 ret = libxml2mod.xmlCtxtReadFile(self._o, filename, encoding, options)
4280 if ret is None:raise treeError('xmlCtxtReadFile() failed')
4281 __tmp = xmlDoc(_obj=ret)
4282 return __tmp
4283
4284 def ctxtReadMemory(self, buffer, size, URL, encoding, options):
4285 """parse an XML in-memory document and build a tree. This
4286 reuses the existing @ctxt parser context """
4287 ret = libxml2mod.xmlCtxtReadMemory(self._o, buffer, size, URL, encoding, options)
4288 if ret is None:raise treeError('xmlCtxtReadMemory() failed')
4289 __tmp = xmlDoc(_obj=ret)
4290 return __tmp
4291
4292 def ctxtReset(self):
4293 """Reset a parser context """
4294 libxml2mod.xmlCtxtReset(self._o)
4295
4296 def ctxtResetPush(self, chunk, size, filename, encoding):
4297 """Reset a push parser context """
4298 ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding)
4299 return ret
4300
4301 def ctxtUseOptions(self, options):
4302 """Applies the options to the parser context """
4303 ret = libxml2mod.xmlCtxtUseOptions(self._o, options)
4304 return ret
4305
4306 def initParserCtxt(self):
4307 """Initialize a parser context """
4308 ret = libxml2mod.xmlInitParserCtxt(self._o)
4309 return ret
4310
4311 def parseChunk(self, chunk, size, terminate):
4312 """Parse a Chunk of memory """
4313 ret = libxml2mod.xmlParseChunk(self._o, chunk, size, terminate)
4314 return ret
4315
4316 def parseDocument(self):
4317 """parse an XML document (and build a tree if using the
4318 standard SAX interface). [1] document ::= prolog element
4319 Misc* [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? """
4320 ret = libxml2mod.xmlParseDocument(self._o)
4321 return ret
4322
4323 def parseExtParsedEnt(self):
4324 """parse a general parsed entity An external general parsed
4325 entity is well-formed if it matches the production labeled
4326 extParsedEnt. [78] extParsedEnt ::= TextDecl? content """
4327 ret = libxml2mod.xmlParseExtParsedEnt(self._o)
4328 return ret
4329
4330 def setupParserForBuffer(self, buffer, filename):
4331 """Setup the parser context to parse a new buffer; Clears any
4332 prior contents from the parser context. The buffer
4333 parameter must not be None, but the filename parameter can
4334 be """
4335 libxml2mod.xmlSetupParserForBuffer(self._o, buffer, filename)
4336
4337 def stopParser(self):
4338 """Blocks further parser processing """
4339 libxml2mod.xmlStopParser(self._o)
4340
4341 #
4342 # parserCtxt functions from module parserInternals
4343 #
4344
4345 def decodeEntities(self, len, what, end, end2, end3):
4346 """This function is deprecated, we now always process entities
4347 content through xmlStringDecodeEntities TODO: remove it in
4348 next major release. [67] Reference ::= EntityRef | CharRef
4349 [69] PEReference ::= '%' Name ';' """
4350 ret = libxml2mod.xmlDecodeEntities(self._o, len, what, end, end2, end3)
4351 return ret
4352
4353 def handleEntity(self, entity):
4354 """Default handling of defined entities, when should we define
4355 a new input stream ? When do we just handle that as a set
4356 of chars ? OBSOLETE: to be removed at some point. """
4357 if entity is None: entity__o = None
4358 else: entity__o = entity._o
4359 libxml2mod.xmlHandleEntity(self._o, entity__o)
4360
4361 def namespaceParseNCName(self):
4362 """parse an XML namespace name. TODO: this seems not in use
4363 anymore, the namespace handling is done on top of the SAX
4364 interfaces, i.e. not on raw input. [NS 3] NCName ::=
4365 (Letter | '_') (NCNameChar)* [NS 4] NCNameChar ::= Letter
4366 | Digit | '.' | '-' | '_' | CombiningChar | Extender """
4367 ret = libxml2mod.xmlNamespaceParseNCName(self._o)
4368 return ret
4369
4370 def namespaceParseNSDef(self):
4371 """parse a namespace prefix declaration TODO: this seems not
4372 in use anymore, the namespace handling is done on top of
4373 the SAX interfaces, i.e. not on raw input. [NS 1] NSDef
4374 ::= PrefixDef Eq SystemLiteral [NS 2] PrefixDef ::=
4375 'xmlns' (':' NCName)? """
4376 ret = libxml2mod.xmlNamespaceParseNSDef(self._o)
4377 return ret
4378
4379 def nextChar(self):
4380 """Skip to the next char input char. """
4381 libxml2mod.xmlNextChar(self._o)
4382
4383 def parseAttValue(self):
4384 """parse a value for an attribute Note: the parser won't do
4385 substitution of entities here, this will be handled later
4386 in xmlStringGetNodeList [10] AttValue ::= '"' ([^<&"] |
4387 Reference)* '"' | "'" ([^<&'] | Reference)* "'" 3.3.3
4388 Attribute-Value Normalization: Before the value of an
4389 attribute is passed to the application or checked for
4390 validity, the XML processor must normalize it as follows: -
4391 a character reference is processed by appending the
4392 referenced character to the attribute value - an entity
4393 reference is processed by recursively processing the
4394 replacement text of the entity - a whitespace character
4395 (#x20, #xD, #xA, #x9) is processed by appending #x20 to the
4396 normalized value, except that only a single #x20 is
4397 appended for a "#xD#xA" sequence that is part of an
4398 external parsed entity or the literal entity value of an
4399 internal parsed entity - other characters are processed by
4400 appending them to the normalized value If the declared
4401 value is not CDATA, then the XML processor must further
4402 process the normalized attribute value by discarding any
4403 leading and trailing space (#x20) characters, and by
4404 replacing sequences of space (#x20) characters by a single
4405 space (#x20) character. All attributes for which no
4406 declaration has been read should be treated by a
4407 non-validating parser as if declared CDATA. """
4408 ret = libxml2mod.xmlParseAttValue(self._o)
4409 return ret
4410
4411 def parseAttributeListDecl(self):
4412 """: parse the Attribute list def for an element [52]
4413 AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53]
4414 AttDef ::= S Name S AttType S DefaultDecl """
4415 libxml2mod.xmlParseAttributeListDecl(self._o)
4416
4417 def parseCDSect(self):
4418 """Parse escaped pure raw content. [18] CDSect ::= CDStart
4419 CData CDEnd [19] CDStart ::= '<![CDATA[' [20] Data ::=
4420 (Char* - (Char* ']]>' Char*)) [21] CDEnd ::= ']]>' """
4421 libxml2mod.xmlParseCDSect(self._o)
4422
4423 def parseCharData(self, cdata):
4424 """parse a CharData section. if we are within a CDATA section
4425 ']]>' marks an end of section. The right angle bracket (>)
4426 may be represented using the string "&gt;", and must, for
4427 compatibility, be escaped using "&gt;" or a character
4428 reference when it appears in the string "]]>" in content,
4429 when that string is not marking the end of a CDATA section.
4430 [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) """
4431 libxml2mod.xmlParseCharData(self._o, cdata)
4432
4433 def parseCharRef(self):
4434 """parse Reference declarations [66] CharRef ::= '&#' [0-9]+
4435 ';' | '&#x' [0-9a-fA-F]+ ';' [ WFC: Legal Character ]
4436 Characters referred to using character references must
4437 match the production for Char. """
4438 ret = libxml2mod.xmlParseCharRef(self._o)
4439 return ret
4440
4441 def parseComment(self):
4442 """Skip an XML (SGML) comment <!-- .... --> The spec says that
4443 "For compatibility, the string "--" (double-hyphen) must
4444 not occur within comments. " [15] Comment ::= '<!--'
4445 ((Char - '-') | ('-' (Char - '-')))* '-->' """
4446 libxml2mod.xmlParseComment(self._o)
4447
4448 def parseContent(self):
4449 """Parse a content: [43] content ::= (element | CharData |
4450 Reference | CDSect | PI | Comment)* """
4451 libxml2mod.xmlParseContent(self._o)
4452
4453 def parseDocTypeDecl(self):
4454 """parse a DOCTYPE declaration [28] doctypedecl ::=
4455 '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl |
4456 PEReference | S)* ']' S?)? '>' [ VC: Root Element Type ]
4457 The Name in the document type declaration must match the
4458 element type of the root element. """
4459 libxml2mod.xmlParseDocTypeDecl(self._o)
4460
4461 def parseElement(self):
4462 """parse an XML element, this is highly recursive [39]
4463 element ::= EmptyElemTag | STag content ETag [ WFC:
4464 Element Type Match ] The Name in an element's end-tag must
4465 match the element type in the start-tag. """
4466 libxml2mod.xmlParseElement(self._o)
4467
4468 def parseElementDecl(self):
4469 """parse an Element declaration. [45] elementdecl ::=
4470 '<!ELEMENT' S Name S contentspec S? '>' [ VC: Unique
4471 Element Type Declaration ] No element type may be declared
4472 more than once """
4473 ret = libxml2mod.xmlParseElementDecl(self._o)
4474 return ret
4475
4476 def parseEncName(self):
4477 """parse the XML encoding name [81] EncName ::= [A-Za-z]
4478 ([A-Za-z0-9._] | '-')* """
4479 ret = libxml2mod.xmlParseEncName(self._o)
4480 return ret
4481
4482 def parseEncodingDecl(self):
4483 """parse the XML encoding declaration [80] EncodingDecl ::= S
4484 'encoding' Eq ('"' EncName '"' | "'" EncName "'") this
4485 setups the conversion filters. """
4486 ret = libxml2mod.xmlParseEncodingDecl(self._o)
4487 return ret
4488
4489 def parseEndTag(self):
4490 """parse an end of tag [42] ETag ::= '</' Name S? '>' With
4491 namespace [NS 9] ETag ::= '</' QName S? '>' """
4492 libxml2mod.xmlParseEndTag(self._o)
4493
4494 def parseEntityDecl(self):
4495 """parse <!ENTITY declarations [70] EntityDecl ::= GEDecl |
4496 PEDecl [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S?
4497 '>' [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
4498 [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
4499 [74] PEDef ::= EntityValue | ExternalID [76] NDataDecl ::=
4500 S 'NDATA' S Name [ VC: Notation Declared ] The Name must
4501 match the declared name of a notation. """
4502 libxml2mod.xmlParseEntityDecl(self._o)
4503
4504 def parseEntityRef(self):
4505 """parse ENTITY references declarations [68] EntityRef ::=
4506 '&' Name ';' [ WFC: Entity Declared ] In a document
4507 without any DTD, a document with only an internal DTD
4508 subset which contains no parameter entity references, or a
4509 document with "standalone='yes'", the Name given in the
4510 entity reference must match that in an entity declaration,
4511 except that well-formed documents need not declare any of
4512 the following entities: amp, lt, gt, apos, quot. The
4513 declaration of a parameter entity must precede any
4514 reference to it. Similarly, the declaration of a general
4515 entity must precede any reference to it which appears in a
4516 default value in an attribute-list declaration. Note that
4517 if entities are declared in the external subset or in
4518 external parameter entities, a non-validating processor is
4519 not obligated to read and process their declarations; for
4520 such documents, the rule that an entity must be declared is
4521 a well-formedness constraint only if standalone='yes'. [
4522 WFC: Parsed Entity ] An entity reference must not contain
4523 the name of an unparsed entity """
4524 ret = libxml2mod.xmlParseEntityRef(self._o)
4525 if ret is None:raise parserError('xmlParseEntityRef() failed')
4526 __tmp = xmlEntity(_obj=ret)
4527 return __tmp
4528
4529 def parseExternalSubset(self, ExternalID, SystemID):
4530 """parse Markup declarations from an external subset [30]
4531 extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl
4532 ::= (markupdecl | conditionalSect | PEReference | S) * """
4533 libxml2mod.xmlParseExternalSubset(self._o, ExternalID, SystemID)
4534
4535 def parseMarkupDecl(self):
4536 """parse Markup declarations [29] markupdecl ::= elementdecl
4537 | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [
4538 VC: Proper Declaration/PE Nesting ] Parameter-entity
4539 replacement text must be properly nested with markup
4540 declarations. That is to say, if either the first character
4541 or the last character of a markup declaration (markupdecl
4542 above) is contained in the replacement text for a
4543 parameter-entity reference, both must be contained in the
4544 same replacement text. [ WFC: PEs in Internal Subset ] In
4545 the internal DTD subset, parameter-entity references can
4546 occur only where markup declarations can occur, not within
4547 markup declarations. (This does not apply to references
4548 that occur in external parameter entities or to the
4549 external subset.) """
4550 libxml2mod.xmlParseMarkupDecl(self._o)
4551
4552 def parseMisc(self):
4553 """parse an XML Misc* optional field. [27] Misc ::= Comment |
4554 PI | S """
4555 libxml2mod.xmlParseMisc(self._o)
4556
4557 def parseName(self):
4558 """parse an XML name. [4] NameChar ::= Letter | Digit | '.' |
4559 '-' | '_' | ':' | CombiningChar | Extender [5] Name ::=
4560 (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20
4561 Name)* """
4562 ret = libxml2mod.xmlParseName(self._o)
4563 return ret
4564
4565 def parseNamespace(self):
4566 """xmlParseNamespace: parse specific PI '<?namespace ...'
4567 constructs. This is what the older xml-name Working Draft
4568 specified, a bunch of other stuff may still rely on it, so
4569 support is still here as if it was declared on the root of
4570 the Tree:-( TODO: remove from library To be removed at
4571 next drop of binary compatibility """
4572 libxml2mod.xmlParseNamespace(self._o)
4573
4574 def parseNmtoken(self):
4575 """parse an XML Nmtoken. [7] Nmtoken ::= (NameChar)+ [8]
4576 Nmtokens ::= Nmtoken (#x20 Nmtoken)* """
4577 ret = libxml2mod.xmlParseNmtoken(self._o)
4578 return ret
4579
4580 def parseNotationDecl(self):
4581 """parse a notation declaration [82] NotationDecl ::=
4582 '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
4583 Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral
4584 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S
4585 SystemLiteral See the NOTE on xmlParseExternalID(). """
4586 libxml2mod.xmlParseNotationDecl(self._o)
4587
4588 def parsePEReference(self):
4589 """parse PEReference declarations The entity content is
4590 handled directly by pushing it's content as a new input
4591 stream. [69] PEReference ::= '%' Name ';' [ WFC: No
4592 Recursion ] A parsed entity must not contain a recursive
4593 reference to itself, either directly or indirectly. [ WFC:
4594 Entity Declared ] In a document without any DTD, a document
4595 with only an internal DTD subset which contains no
4596 parameter entity references, or a document with
4597 "standalone='yes'", ... ... The declaration of a parameter
4598 entity must precede any reference to it... [ VC: Entity
4599 Declared ] In a document with an external subset or
4600 external parameter entities with "standalone='no'", ...
4601 ... The declaration of a parameter entity must precede any
4602 reference to it... [ WFC: In DTD ] Parameter-entity
4603 references may only appear in the DTD. NOTE: misleading but
4604 this is handled. """
4605 libxml2mod.xmlParsePEReference(self._o)
4606
4607 def parsePI(self):
4608 """parse an XML Processing Instruction. [16] PI ::= '<?'
4609 PITarget (S (Char* - (Char* '?>' Char*)))? '?>' The
4610 processing is transfered to SAX once parsed. """
4611 libxml2mod.xmlParsePI(self._o)
4612
4613 def parsePITarget(self):
4614 """parse the name of a PI [17] PITarget ::= Name - (('X' |
4615 'x') ('M' | 'm') ('L' | 'l')) """
4616 ret = libxml2mod.xmlParsePITarget(self._o)
4617 return ret
4618
4619 def parsePubidLiteral(self):
4620 """parse an XML public literal [12] PubidLiteral ::= '"'
4621 PubidChar* '"' | "'" (PubidChar - "'")* "'" """
4622 ret = libxml2mod.xmlParsePubidLiteral(self._o)
4623 return ret
4624
4625 def parseQuotedString(self):
4626 """Parse and return a string between quotes or doublequotes
4627 TODO: Deprecated, to be removed at next drop of binary
4628 compatibility """
4629 ret = libxml2mod.xmlParseQuotedString(self._o)
4630 return ret
4631
4632 def parseReference(self):
4633 """parse and handle entity references in content, depending on
4634 the SAX interface, this may end-up in a call to character()
4635 if this is a CharRef, a predefined entity, if there is no
4636 reference() callback. or if the parser was asked to switch
4637 to that mode. [67] Reference ::= EntityRef | CharRef """
4638 libxml2mod.xmlParseReference(self._o)
4639
4640 def parseSDDecl(self):
4641 """parse the XML standalone declaration [32] SDDecl ::= S
4642 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' |
4643 'no')'"')) [ VC: Standalone Document Declaration ] TODO
4644 The standalone document declaration must have the value
4645 "no" if any external markup declarations contain
4646 declarations of: - attributes with default values, if
4647 elements to which these attributes apply appear in the
4648 document without specifications of values for these
4649 attributes, or - entities (other than amp, lt, gt, apos,
4650 quot), if references to those entities appear in the
4651 document, or - attributes with values subject to
4652 normalization, where the attribute appears in the document
4653 with a value which will change as a result of
4654 normalization, or - element types with element content, if
4655 white space occurs directly within any instance of those
4656 types. """
4657 ret = libxml2mod.xmlParseSDDecl(self._o)
4658 return ret
4659
4660 def parseStartTag(self):
4661 """parse a start of tag either for rule element or
4662 EmptyElement. In both case we don't parse the tag closing
4663 chars. [40] STag ::= '<' Name (S Attribute)* S? '>' [
4664 WFC: Unique Att Spec ] No attribute name may appear more
4665 than once in the same start-tag or empty-element tag. [44]
4666 EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [ WFC:
4667 Unique Att Spec ] No attribute name may appear more than
4668 once in the same start-tag or empty-element tag. With
4669 namespace: [NS 8] STag ::= '<' QName (S Attribute)* S? '>'
4670 [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>' """
4671 ret = libxml2mod.xmlParseStartTag(self._o)
4672 return ret
4673
4674 def parseSystemLiteral(self):
4675 """parse an XML Literal [11] SystemLiteral ::= ('"' [^"]*
4676 '"') | ("'" [^']* "'") """
4677 ret = libxml2mod.xmlParseSystemLiteral(self._o)
4678 return ret
4679
4680 def parseTextDecl(self):
4681 """parse an XML declaration header for external entities [77]
4682 TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' """
4683 libxml2mod.xmlParseTextDecl(self._o)
4684
4685 def parseVersionInfo(self):
4686 """parse the XML version. [24] VersionInfo ::= S 'version' Eq
4687 (' VersionNum ' | " VersionNum ") [25] Eq ::= S? '=' S? """
4688 ret = libxml2mod.xmlParseVersionInfo(self._o)
4689 return ret
4690
4691 def parseVersionNum(self):
4692 """parse the XML version value. [26] VersionNum ::= '1.'
4693 [0-9]+ In practice allow [0-9].[0-9]+ at that level """
4694 ret = libxml2mod.xmlParseVersionNum(self._o)
4695 return ret
4696
4697 def parseXMLDecl(self):
4698 """parse an XML declaration header [23] XMLDecl ::= '<?xml'
4699 VersionInfo EncodingDecl? SDDecl? S? '?>' """
4700 libxml2mod.xmlParseXMLDecl(self._o)
4701
4702 def parserHandlePEReference(self):
4703 """[69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A
4704 parsed entity must not contain a recursive reference to
4705 itself, either directly or indirectly. [ WFC: Entity
4706 Declared ] In a document without any DTD, a document with
4707 only an internal DTD subset which contains no parameter
4708 entity references, or a document with "standalone='yes'",
4709 ... ... The declaration of a parameter entity must precede
4710 any reference to it... [ VC: Entity Declared ] In a
4711 document with an external subset or external parameter
4712 entities with "standalone='no'", ... ... The declaration
4713 of a parameter entity must precede any reference to it...
4714 [ WFC: In DTD ] Parameter-entity references may only appear
4715 in the DTD. NOTE: misleading but this is handled. A
4716 PEReference may have been detected in the current input
4717 stream the handling is done accordingly to
4718 http://www.w3.org/TR/REC-xml#entproc i.e. - Included in
4719 literal in entity values - Included as Parameter Entity
4720 reference within DTDs """
4721 libxml2mod.xmlParserHandlePEReference(self._o)
4722
4723 def parserHandleReference(self):
4724 """TODO: Remove, now deprecated ... the test is done directly
4725 in the content parsing routines. [67] Reference ::=
4726 EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [
4727 WFC: Entity Declared ] the Name given in the entity
4728 reference must match that in an entity declaration, except
4729 that well-formed documents need not declare any of the
4730 following entities: amp, lt, gt, apos, quot. [ WFC: Parsed
4731 Entity ] An entity reference must not contain the name of
4732 an unparsed entity [66] CharRef ::= '&#' [0-9]+ ';' |
4733 '&#x' [0-9a-fA-F]+ ';' A PEReference may have been
4734 detected in the current input stream the handling is done
4735 accordingly to http://www.w3.org/TR/REC-xml#entproc """
4736 libxml2mod.xmlParserHandleReference(self._o)
4737
4738 def popInput(self):
4739 """xmlPopInput: the current input pointed by ctxt->input came
4740 to an end pop it and return the next char. """
4741 ret = libxml2mod.xmlPopInput(self._o)
4742 return ret
4743
4744 def scanName(self):
4745 """Trickery: parse an XML name but without consuming the input
4746 flow Needed for rollback cases. Used only when parsing
4747 entities references. TODO: seems deprecated now, only used
4748 in the default part of xmlParserHandleReference [4]
4749 NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
4750 CombiningChar | Extender [5] Name ::= (Letter | '_' | ':')
4751 (NameChar)* [6] Names ::= Name (S Name)* """
4752 ret = libxml2mod.xmlScanName(self._o)
4753 return ret
4754
4755 def skipBlankChars(self):
4756 """skip all blanks character found at that point in the input
4757 streams. It pops up finished entities in the process if
4758 allowable at that point. """
4759 ret = libxml2mod.xmlSkipBlankChars(self._o)
4760 return ret
4761
4762 def stringDecodeEntities(self, str, what, end, end2, end3):
4763 """Takes a entity string content and process to do the
4764 adequate substitutions. [67] Reference ::= EntityRef |
4765 CharRef [69] PEReference ::= '%' Name ';' """
4766 ret = libxml2mod.xmlStringDecodeEntities(self._o, str, what, end, end2, end3)
4767 return ret
4768
4769 def stringLenDecodeEntities(self, str, len, what, end, end2, end3):
4770 """Takes a entity string content and process to do the
4771 adequate substitutions. [67] Reference ::= EntityRef |
4772 CharRef [69] PEReference ::= '%' Name ';' """
4773 ret = libxml2mod.xmlStringLenDecodeEntities(self._o, str, len, what, end, end2, end3)
4774 return ret
4775
4776class xmlAttr(xmlNode):
4777 def __init__(self, _obj=None):
4778 if checkWrapper(_obj) != 0: raise TypeError('xmlAttr got a wrong wrapper object type')
4779 self._o = _obj
4780 xmlNode.__init__(self, _obj=_obj)
4781
4782 def __repr__(self):
4783 return "<xmlAttr (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
4784
4785 #
4786 # xmlAttr functions from module debugXML
4787 #
4788
4789 def debugDumpAttr(self, output, depth):
4790 """Dumps debug information for the attribute """
4791 libxml2mod.xmlDebugDumpAttr(output, self._o, depth)
4792
4793 def debugDumpAttrList(self, output, depth):
4794 """Dumps debug information for the attribute list """
4795 libxml2mod.xmlDebugDumpAttrList(output, self._o, depth)
4796
4797 #
4798 # xmlAttr functions from module tree
4799 #
4800
4801 def copyProp(self, target):
4802 """Do a copy of the attribute. """
4803 if target is None: target__o = None
4804 else: target__o = target._o
4805 ret = libxml2mod.xmlCopyProp(target__o, self._o)
4806 if ret is None:raise treeError('xmlCopyProp() failed')
4807 __tmp = xmlAttr(_obj=ret)
4808 return __tmp
4809
4810 def copyPropList(self, target):
4811 """Do a copy of an attribute list. """
4812 if target is None: target__o = None
4813 else: target__o = target._o
4814 ret = libxml2mod.xmlCopyPropList(target__o, self._o)
4815 if ret is None:raise treeError('xmlCopyPropList() failed')
4816 __tmp = xmlAttr(_obj=ret)
4817 return __tmp
4818
4819 def freeProp(self):
4820 """Free one attribute, all the content is freed too """
4821 libxml2mod.xmlFreeProp(self._o)
4822
4823 def freePropList(self):
4824 """Free a property and all its siblings, all the children are
4825 freed too. """
4826 libxml2mod.xmlFreePropList(self._o)
4827
4828 def removeProp(self):
4829 """Unlink and free one attribute, all the content is freed too
4830 Note this doesn't work for namespace definition attributes """
4831 ret = libxml2mod.xmlRemoveProp(self._o)
4832 return ret
4833
4834 #
4835 # xmlAttr functions from module valid
4836 #
4837
4838 def removeID(self, doc):
4839 """Remove the given attribute from the ID table maintained
4840 internally. """
4841 if doc is None: doc__o = None
4842 else: doc__o = doc._o
4843 ret = libxml2mod.xmlRemoveID(doc__o, self._o)
4844 return ret
4845
4846 def removeRef(self, doc):
4847 """Remove the given attribute from the Ref table maintained
4848 internally. """
4849 if doc is None: doc__o = None
4850 else: doc__o = doc._o
4851 ret = libxml2mod.xmlRemoveRef(doc__o, self._o)
4852 return ret
4853
4854class xmlAttribute(xmlNode):
4855 def __init__(self, _obj=None):
4856 if checkWrapper(_obj) != 0: raise TypeError('xmlAttribute got a wrong wrapper object type')
4857 self._o = _obj
4858 xmlNode.__init__(self, _obj=_obj)
4859
4860 def __repr__(self):
4861 return "<xmlAttribute (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
4862
4863class catalog:
4864 def __init__(self, _obj=None):
4865 if _obj != None:self._o = _obj;return
4866 self._o = None
4867
4868 def __del__(self):
4869 if self._o != None:
4870 libxml2mod.xmlFreeCatalog(self._o)
4871 self._o = None
4872
4873 #
4874 # catalog functions from module catalog
4875 #
4876
4877 def add(self, type, orig, replace):
4878 """Add an entry in the catalog, it may overwrite existing but
4879 different entries. """
4880 ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace)
4881 return ret
4882
4883 def catalogIsEmpty(self):
4884 """Check is a catalog is empty """
4885 ret = libxml2mod.xmlCatalogIsEmpty(self._o)
4886 return ret
4887
4888 def convertSGMLCatalog(self):
4889 """Convert all the SGML catalog entries as XML ones """
4890 ret = libxml2mod.xmlConvertSGMLCatalog(self._o)
4891 return ret
4892
4893 def dump(self, out):
4894 """Dump the given catalog to the given file. """
4895 libxml2mod.xmlACatalogDump(self._o, out)
4896
4897 def remove(self, value):
4898 """Remove an entry from the catalog """
4899 ret = libxml2mod.xmlACatalogRemove(self._o, value)
4900 return ret
4901
4902 def resolve(self, pubID, sysID):
4903 """Do a complete resolution lookup of an External Identifier """
4904 ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID)
4905 return ret
4906
4907 def resolvePublic(self, pubID):
4908 """Try to lookup the catalog local reference associated to a
4909 public ID in that catalog """
4910 ret = libxml2mod.xmlACatalogResolvePublic(self._o, pubID)
4911 return ret
4912
4913 def resolveSystem(self, sysID):
4914 """Try to lookup the catalog resource for a system ID """
4915 ret = libxml2mod.xmlACatalogResolveSystem(self._o, sysID)
4916 return ret
4917
4918 def resolveURI(self, URI):
4919 """Do a complete resolution lookup of an URI """
4920 ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
4921 return ret
4922
4923class xmlDtd(xmlNode):
4924 def __init__(self, _obj=None):
4925 if checkWrapper(_obj) != 0: raise TypeError('xmlDtd got a wrong wrapper object type')
4926 self._o = _obj
4927 xmlNode.__init__(self, _obj=_obj)
4928
4929 def __repr__(self):
4930 return "<xmlDtd (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
4931
4932 #
4933 # xmlDtd functions from module debugXML
4934 #
4935
4936 def debugDumpDTD(self, output):
4937 """Dumps debug information for the DTD """
4938 libxml2mod.xmlDebugDumpDTD(output, self._o)
4939
4940 #
4941 # xmlDtd functions from module tree
4942 #
4943
4944 def copyDtd(self):
4945 """Do a copy of the dtd. """
4946 ret = libxml2mod.xmlCopyDtd(self._o)
4947 if ret is None:raise treeError('xmlCopyDtd() failed')
4948 __tmp = xmlDtd(_obj=ret)
4949 return __tmp
4950
4951 def freeDtd(self):
4952 """Free a DTD structure. """
4953 libxml2mod.xmlFreeDtd(self._o)
4954
4955 #
4956 # xmlDtd functions from module valid
4957 #
4958
4959 def dtdAttrDesc(self, elem, name):
4960 """Search the DTD for the description of this attribute on
4961 this element. """
4962 ret = libxml2mod.xmlGetDtdAttrDesc(self._o, elem, name)
4963 if ret is None:raise treeError('xmlGetDtdAttrDesc() failed')
4964 __tmp = xmlAttribute(_obj=ret)
4965 return __tmp
4966
4967 def dtdElementDesc(self, name):
4968 """Search the DTD for the description of this element """
4969 ret = libxml2mod.xmlGetDtdElementDesc(self._o, name)
4970 if ret is None:raise treeError('xmlGetDtdElementDesc() failed')
4971 __tmp = xmlElement(_obj=ret)
4972 return __tmp
4973
4974 def dtdQAttrDesc(self, elem, name, prefix):
4975 """Search the DTD for the description of this qualified
4976 attribute on this element. """
4977 ret = libxml2mod.xmlGetDtdQAttrDesc(self._o, elem, name, prefix)
4978 if ret is None:raise treeError('xmlGetDtdQAttrDesc() failed')
4979 __tmp = xmlAttribute(_obj=ret)
4980 return __tmp
4981
4982 def dtdQElementDesc(self, name, prefix):
4983 """Search the DTD for the description of this element """
4984 ret = libxml2mod.xmlGetDtdQElementDesc(self._o, name, prefix)
4985 if ret is None:raise treeError('xmlGetDtdQElementDesc() failed')
4986 __tmp = xmlElement(_obj=ret)
4987 return __tmp
4988
4989class xmlElement(xmlNode):
4990 def __init__(self, _obj=None):
4991 if checkWrapper(_obj) != 0: raise TypeError('xmlElement got a wrong wrapper object type')
4992 self._o = _obj
4993 xmlNode.__init__(self, _obj=_obj)
4994
4995 def __repr__(self):
4996 return "<xmlElement (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
4997
4998class xmlEntity(xmlNode):
4999 def __init__(self, _obj=None):
5000 if checkWrapper(_obj) != 0: raise TypeError('xmlEntity got a wrong wrapper object type')
5001 self._o = _obj
5002 xmlNode.__init__(self, _obj=_obj)
5003
5004 def __repr__(self):
5005 return "<xmlEntity (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
5006
5007 #
5008 # xmlEntity functions from module parserInternals
5009 #
5010
5011 def handleEntity(self, ctxt):
5012 """Default handling of defined entities, when should we define
5013 a new input stream ? When do we just handle that as a set
5014 of chars ? OBSOLETE: to be removed at some point. """
5015 if ctxt is None: ctxt__o = None
5016 else: ctxt__o = ctxt._o
5017 libxml2mod.xmlHandleEntity(ctxt__o, self._o)
5018
5019class Error:
5020 def __init__(self, _obj=None):
5021 if _obj != None:self._o = _obj;return
5022 self._o = None
5023
5024 # accessors for Error
5025 def code(self):
5026 """The error code, e.g. an xmlParserError """
5027 ret = libxml2mod.xmlErrorGetCode(self._o)
5028 return ret
5029
5030 def domain(self):
5031 """What part of the library raised this error """
5032 ret = libxml2mod.xmlErrorGetDomain(self._o)
5033 return ret
5034
5035 def file(self):
5036 """the filename """
5037 ret = libxml2mod.xmlErrorGetFile(self._o)
5038 return ret
5039
5040 def level(self):
5041 """how consequent is the error """
5042 ret = libxml2mod.xmlErrorGetLevel(self._o)
5043 return ret
5044
5045 def line(self):
5046 """the line number if available """
5047 ret = libxml2mod.xmlErrorGetLine(self._o)
5048 return ret
5049
5050 def message(self):
5051 """human-readable informative error message """
5052 ret = libxml2mod.xmlErrorGetMessage(self._o)
5053 return ret
5054
5055 #
5056 # Error functions from module xmlerror
5057 #
5058
5059 def copyError(self, to):
5060 """Save the original error to the new place. """
5061 if to is None: to__o = None
5062 else: to__o = to._o
5063 ret = libxml2mod.xmlCopyError(self._o, to__o)
5064 return ret
5065
5066 def resetError(self):
5067 """Cleanup the error. """
5068 libxml2mod.xmlResetError(self._o)
5069
5070class xmlNs(xmlNode):
5071 def __init__(self, _obj=None):
5072 if checkWrapper(_obj) != 0: raise TypeError('xmlNs got a wrong wrapper object type')
5073 self._o = _obj
5074 xmlNode.__init__(self, _obj=_obj)
5075
5076 def __repr__(self):
5077 return "<xmlNs (%s) object at 0x%x>" % (self.name, int(pos_id (self)))
5078
5079 #
5080 # xmlNs functions from module tree
5081 #
5082
5083 def copyNamespace(self):
5084 """Do a copy of the namespace. """
5085 ret = libxml2mod.xmlCopyNamespace(self._o)
5086 if ret is None:raise treeError('xmlCopyNamespace() failed')
5087 __tmp = xmlNs(_obj=ret)
5088 return __tmp
5089
5090 def copyNamespaceList(self):
5091 """Do a copy of an namespace list. """
5092 ret = libxml2mod.xmlCopyNamespaceList(self._o)
5093 if ret is None:raise treeError('xmlCopyNamespaceList() failed')
5094 __tmp = xmlNs(_obj=ret)
5095 return __tmp
5096
5097 def freeNs(self):
5098 """Free up the structures associated to a namespace """
5099 libxml2mod.xmlFreeNs(self._o)
5100
5101 def freeNsList(self):
5102 """Free up all the structures associated to the chained
5103 namespaces. """
5104 libxml2mod.xmlFreeNsList(self._o)
5105
5106 def newChild(self, parent, name, content):
5107 """Creation of a new child element, added at the end of
5108 @parent children list. @ns and @content parameters are
5109 optional (None). If @ns is None, the newly created element
5110 inherits the namespace of @parent. If @content is non None,
5111 a child list containing the TEXTs and ENTITY_REFs node will
5112 be created. NOTE: @content is supposed to be a piece of XML
5113 CDATA, so it allows entity references. XML special chars
5114 must be escaped first by using
5115 xmlEncodeEntitiesReentrant(), or xmlNewTextChild() should
5116 be used. """
5117 if parent is None: parent__o = None
5118 else: parent__o = parent._o
5119 ret = libxml2mod.xmlNewChild(parent__o, self._o, name, content)
5120 if ret is None:raise treeError('xmlNewChild() failed')
5121 __tmp = xmlNode(_obj=ret)
5122 return __tmp
5123
5124 def newDocNode(self, doc, name, content):
5125 """Creation of a new node element within a document. @ns and
5126 @content are optional (None). NOTE: @content is supposed to
5127 be a piece of XML CDATA, so it allow entities references,
5128 but XML special chars need to be escaped first by using
5129 xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
5130 don't need entities support. """
5131 if doc is None: doc__o = None
5132 else: doc__o = doc._o
5133 ret = libxml2mod.xmlNewDocNode(doc__o, self._o, name, content)
5134 if ret is None:raise treeError('xmlNewDocNode() failed')
5135 __tmp = xmlNode(_obj=ret)
5136 return __tmp
5137
5138 def newDocNodeEatName(self, doc, name, content):
5139 """Creation of a new node element within a document. @ns and
5140 @content are optional (None). NOTE: @content is supposed to
5141 be a piece of XML CDATA, so it allow entities references,
5142 but XML special chars need to be escaped first by using
5143 xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNode() if you
5144 don't need entities support. """
5145 if doc is None: doc__o = None
5146 else: doc__o = doc._o
5147 ret = libxml2mod.xmlNewDocNodeEatName(doc__o, self._o, name, content)
5148 if ret is None:raise treeError('xmlNewDocNodeEatName() failed')
5149 __tmp = xmlNode(_obj=ret)
5150 return __tmp
5151
5152 def newDocRawNode(self, doc, name, content):
5153 """Creation of a new node element within a document. @ns and
5154 @content are optional (None). """
5155 if doc is None: doc__o = None
5156 else: doc__o = doc._o
5157 ret = libxml2mod.xmlNewDocRawNode(doc__o, self._o, name, content)
5158 if ret is None:raise treeError('xmlNewDocRawNode() failed')
5159 __tmp = xmlNode(_obj=ret)
5160 return __tmp
5161
5162 def newNodeEatName(self, name):
5163 """Creation of a new node element. @ns is optional (None). """
5164 ret = libxml2mod.xmlNewNodeEatName(self._o, name)
5165 if ret is None:raise treeError('xmlNewNodeEatName() failed')
5166 __tmp = xmlNode(_obj=ret)
5167 return __tmp
5168
5169 def newNsProp(self, node, name, value):
5170 """Create a new property tagged with a namespace and carried
5171 by a node. """
5172 if node is None: node__o = None
5173 else: node__o = node._o
5174 ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value)
5175 if ret is None:raise treeError('xmlNewNsProp() failed')
5176 __tmp = xmlAttr(_obj=ret)
5177 return __tmp
5178
5179 def newNsPropEatName(self, node, name, value):
5180 """Create a new property tagged with a namespace and carried
5181 by a node. """
5182 if node is None: node__o = None
5183 else: node__o = node._o
5184 ret = libxml2mod.xmlNewNsPropEatName(node__o, self._o, name, value)
5185 if ret is None:raise treeError('xmlNewNsPropEatName() failed')
5186 __tmp = xmlAttr(_obj=ret)
5187 return __tmp
5188
5189 def newTextChild(self, parent, name, content):
5190 """Creation of a new child element, added at the end of
5191 @parent children list. @ns and @content parameters are
5192 optional (None). If @ns is None, the newly created element
5193 inherits the namespace of @parent. If @content is non None,
5194 a child TEXT node will be created containing the string
5195 @content. NOTE: Use xmlNewChild() if @content will contain
5196 entities that need to be preserved. Use this function,
5197 xmlNewTextChild(), if you need to ensure that reserved XML
5198 chars that might appear in @content, such as the ampersand,
5199 greater-than or less-than signs, are automatically replaced
5200 by their XML escaped entity representations. """
5201 if parent is None: parent__o = None
5202 else: parent__o = parent._o
5203 ret = libxml2mod.xmlNewTextChild(parent__o, self._o, name, content)
5204 if ret is None:raise treeError('xmlNewTextChild() failed')
5205 __tmp = xmlNode(_obj=ret)
5206 return __tmp
5207
5208 def setNs(self, node):
5209 """Associate a namespace to a node, a posteriori. """
5210 if node is None: node__o = None
5211 else: node__o = node._o
5212 libxml2mod.xmlSetNs(node__o, self._o)
5213
5214 def setNsProp(self, node, name, value):
5215 """Set (or reset) an attribute carried by a node. The ns
5216 structure must be in scope, this is not checked """
5217 if node is None: node__o = None
5218 else: node__o = node._o
5219 ret = libxml2mod.xmlSetNsProp(node__o, self._o, name, value)
5220 if ret is None:raise treeError('xmlSetNsProp() failed')
5221 __tmp = xmlAttr(_obj=ret)
5222 return __tmp
5223
5224 def unsetNsProp(self, node, name):
5225 """Remove an attribute carried by a node. """
5226 if node is None: node__o = None
5227 else: node__o = node._o
5228 ret = libxml2mod.xmlUnsetNsProp(node__o, self._o, name)
5229 return ret
5230
5231 #
5232 # xmlNs functions from module xpathInternals
5233 #
5234
5235 def xpathNodeSetFreeNs(self):
5236 """Namespace nodes in libxml don't match the XPath semantic.
5237 In a node set the namespace nodes are duplicated and the
5238 next pointer is set to the parent node in the XPath
5239 semantic. Check if such a node needs to be freed """
5240 libxml2mod.xmlXPathNodeSetFreeNs(self._o)
5241
5242class outputBuffer(ioWriteWrapper):
5243 def __init__(self, _obj=None):
5244 self._o = _obj
5245 ioWriteWrapper.__init__(self, _obj=_obj)
5246
5247 #
5248 # outputBuffer functions from module HTMLtree
5249 #
5250
5251 def htmlDocContentDumpFormatOutput(self, cur, encoding, format):
5252 """Dump an HTML document. """
5253 if cur is None: cur__o = None
5254 else: cur__o = cur._o
5255 libxml2mod.htmlDocContentDumpFormatOutput(self._o, cur__o, encoding, format)
5256
5257 def htmlDocContentDumpOutput(self, cur, encoding):
5258 """Dump an HTML document. Formating return/spaces are added. """
5259 if cur is None: cur__o = None
5260 else: cur__o = cur._o
5261 libxml2mod.htmlDocContentDumpOutput(self._o, cur__o, encoding)
5262
5263 def htmlNodeDumpFormatOutput(self, doc, cur, encoding, format):
5264 """Dump an HTML node, recursive behaviour,children are printed
5265 too. """
5266 if doc is None: doc__o = None
5267 else: doc__o = doc._o
5268 if cur is None: cur__o = None
5269 else: cur__o = cur._o
5270 libxml2mod.htmlNodeDumpFormatOutput(self._o, doc__o, cur__o, encoding, format)
5271
5272 def htmlNodeDumpOutput(self, doc, cur, encoding):
5273 """Dump an HTML node, recursive behaviour,children are printed
5274 too, and formatting returns/spaces are added. """
5275 if doc is None: doc__o = None
5276 else: doc__o = doc._o
5277 if cur is None: cur__o = None
5278 else: cur__o = cur._o
5279 libxml2mod.htmlNodeDumpOutput(self._o, doc__o, cur__o, encoding)
5280
5281 #
5282 # outputBuffer functions from module tree
5283 #
5284
5285 def nodeDumpOutput(self, doc, cur, level, format, encoding):
5286 """Dump an XML node, recursive behaviour, children are printed
5287 too. Note that @format = 1 provide node indenting only if
5288 xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was
5289 called """
5290 if doc is None: doc__o = None
5291 else: doc__o = doc._o
5292 if cur is None: cur__o = None
5293 else: cur__o = cur._o
5294 libxml2mod.xmlNodeDumpOutput(self._o, doc__o, cur__o, level, format, encoding)
5295
5296 def saveFileTo(self, cur, encoding):
5297 """Dump an XML document to an I/O buffer. Warning ! This call
5298 xmlOutputBufferClose() on buf which is not available after
5299 this call. """
5300 if cur is None: cur__o = None
5301 else: cur__o = cur._o
5302 ret = libxml2mod.xmlSaveFileTo(self._o, cur__o, encoding)
5303 return ret
5304
5305 def saveFormatFileTo(self, cur, encoding, format):
5306 """Dump an XML document to an I/O buffer. Warning ! This call
5307 xmlOutputBufferClose() on buf which is not available after
5308 this call. """
5309 if cur is None: cur__o = None
5310 else: cur__o = cur._o
5311 ret = libxml2mod.xmlSaveFormatFileTo(self._o, cur__o, encoding, format)
5312 return ret
5313
5314 #
5315 # outputBuffer functions from module xmlIO
5316 #
5317
5318 def getContent(self):
5319 """Gives a pointer to the data currently held in the output
5320 buffer """
5321 ret = libxml2mod.xmlOutputBufferGetContent(self._o)
5322 return ret
5323
5324 def write(self, len, buf):
5325 """Write the content of the array in the output I/O buffer
5326 This routine handle the I18N transcoding from internal
5327 UTF-8 The buffer is lossless, i.e. will store in case of
5328 partial or delayed writes. """
5329 ret = libxml2mod.xmlOutputBufferWrite(self._o, len, buf)
5330 return ret
5331
5332 def writeString(self, str):
5333 """Write the content of the string in the output I/O buffer
5334 This routine handle the I18N transcoding from internal
5335 UTF-8 The buffer is lossless, i.e. will store in case of
5336 partial or delayed writes. """
5337 ret = libxml2mod.xmlOutputBufferWriteString(self._o, str)
5338 return ret
5339
5340class inputBuffer(ioReadWrapper):
5341 def __init__(self, _obj=None):
5342 self._o = _obj
5343 ioReadWrapper.__init__(self, _obj=_obj)
5344
5345 def __del__(self):
5346 if self._o != None:
5347 libxml2mod.xmlFreeParserInputBuffer(self._o)
5348 self._o = None
5349
5350 #
5351 # inputBuffer functions from module xmlIO
5352 #
5353
5354 def grow(self, len):
5355 """Grow up the content of the input buffer, the old data are
5356 preserved This routine handle the I18N transcoding to
5357 internal UTF-8 This routine is used when operating the
5358 parser in normal (pull) mode TODO: one should be able to
5359 remove one extra copy by copying directly onto in->buffer
5360 or in->raw """
5361 ret = libxml2mod.xmlParserInputBufferGrow(self._o, len)
5362 return ret
5363
5364 def push(self, len, buf):
5365 """Push the content of the arry in the input buffer This
5366 routine handle the I18N transcoding to internal UTF-8 This
5367 is used when operating the parser in progressive (push)
5368 mode. """
5369 ret = libxml2mod.xmlParserInputBufferPush(self._o, len, buf)
5370 return ret
5371
5372 def read(self, len):
5373 """Refresh the content of the input buffer, the old data are
5374 considered consumed This routine handle the I18N
5375 transcoding to internal UTF-8 """
5376 ret = libxml2mod.xmlParserInputBufferRead(self._o, len)
5377 return ret
5378
5379 #
5380 # inputBuffer functions from module xmlreader
5381 #
5382
5383 def Setup(self, reader, URL, encoding, options):
5384 """Setup an XML reader with new options """
5385 if reader is None: reader__o = None
5386 else: reader__o = reader._o
5387 ret = libxml2mod.xmlTextReaderSetup(reader__o, self._o, URL, encoding, options)
5388 return ret
5389
5390 def newTextReader(self, URI):
5391 """Create an xmlTextReader structure fed with @input """
5392 ret = libxml2mod.xmlNewTextReader(self._o, URI)
5393 if ret is None:raise treeError('xmlNewTextReader() failed')
5394 __tmp = xmlTextReader(_obj=ret)
5395 __tmp.input = self
5396 return __tmp
5397
5398class xmlReg:
5399 def __init__(self, _obj=None):
5400 if _obj != None:self._o = _obj;return
5401 self._o = None
5402
5403 def __del__(self):
5404 if self._o != None:
5405 libxml2mod.xmlRegFreeRegexp(self._o)
5406 self._o = None
5407
5408 #
5409 # xmlReg functions from module xmlregexp
5410 #
5411
5412 def regexpExec(self, content):
5413 """Check if the regular expression generates the value """
5414 ret = libxml2mod.xmlRegexpExec(self._o, content)
5415 return ret
5416
5417 def regexpIsDeterminist(self):
5418 """Check if the regular expression is determinist """
5419 ret = libxml2mod.xmlRegexpIsDeterminist(self._o)
5420 return ret
5421
5422 def regexpPrint(self, output):
5423 """Print the content of the compiled regular expression """
5424 libxml2mod.xmlRegexpPrint(output, self._o)
5425
5426class relaxNgParserCtxt:
5427 def __init__(self, _obj=None):
5428 if _obj != None:self._o = _obj;return
5429 self._o = None
5430
5431 def __del__(self):
5432 if self._o != None:
5433 libxml2mod.xmlRelaxNGFreeParserCtxt(self._o)
5434 self._o = None
5435
5436 #
5437 # relaxNgParserCtxt functions from module relaxng
5438 #
5439
5440 def relaxNGParse(self):
5441 """parse a schema definition resource and build an internal
5442 XML Shema struture which can be used to validate instances. """
5443 ret = libxml2mod.xmlRelaxNGParse(self._o)
5444 if ret is None:raise parserError('xmlRelaxNGParse() failed')
5445 __tmp = relaxNgSchema(_obj=ret)
5446 return __tmp
5447
5448 def relaxParserSetFlag(self, flags):
5449 """Semi private function used to pass informations to a parser
5450 context which are a combination of xmlRelaxNGParserFlag . """
5451 ret = libxml2mod.xmlRelaxParserSetFlag(self._o, flags)
5452 return ret
5453
5454class relaxNgSchema:
5455 def __init__(self, _obj=None):
5456 if _obj != None:self._o = _obj;return
5457 self._o = None
5458
5459 def __del__(self):
5460 if self._o != None:
5461 libxml2mod.xmlRelaxNGFree(self._o)
5462 self._o = None
5463
5464 #
5465 # relaxNgSchema functions from module relaxng
5466 #
5467
5468 def relaxNGDump(self, output):
5469 """Dump a RelaxNG structure back """
5470 libxml2mod.xmlRelaxNGDump(output, self._o)
5471
5472 def relaxNGDumpTree(self, output):
5473 """Dump the transformed RelaxNG tree. """
5474 libxml2mod.xmlRelaxNGDumpTree(output, self._o)
5475
5476 def relaxNGNewValidCtxt(self):
5477 """Create an XML RelaxNGs validation context based on the
5478 given schema """
5479 ret = libxml2mod.xmlRelaxNGNewValidCtxt(self._o)
5480 if ret is None:raise treeError('xmlRelaxNGNewValidCtxt() failed')
5481 __tmp = relaxNgValidCtxt(_obj=ret)
5482 __tmp.schema = self
5483 return __tmp
5484
5485 #
5486 # relaxNgSchema functions from module xmlreader
5487 #
5488
5489 def RelaxNGSetSchema(self, reader):
5490 """Use RelaxNG to validate the document as it is processed.
5491 Activation is only possible before the first Read(). if
5492 @schema is None, then RelaxNG validation is desactivated. @
5493 The @schema should not be freed until the reader is
5494 deallocated or its use has been deactivated. """
5495 if reader is None: reader__o = None
5496 else: reader__o = reader._o
5497 ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(reader__o, self._o)
5498 return ret
5499
5500class relaxNgValidCtxt(relaxNgValidCtxtCore):
5501 def __init__(self, _obj=None):
5502 self.schema = None
5503 self._o = _obj
5504 relaxNgValidCtxtCore.__init__(self, _obj=_obj)
5505
5506 def __del__(self):
5507 if self._o != None:
5508 libxml2mod.xmlRelaxNGFreeValidCtxt(self._o)
5509 self._o = None
5510
5511 #
5512 # relaxNgValidCtxt functions from module relaxng
5513 #
5514
5515 def relaxNGValidateDoc(self, doc):
5516 """Validate a document tree in memory. """
5517 if doc is None: doc__o = None
5518 else: doc__o = doc._o
5519 ret = libxml2mod.xmlRelaxNGValidateDoc(self._o, doc__o)
5520 return ret
5521
5522 def relaxNGValidateFullElement(self, doc, elem):
5523 """Validate a full subtree when
5524 xmlRelaxNGValidatePushElement() returned 0 and the content
5525 of the node has been expanded. """
5526 if doc is None: doc__o = None
5527 else: doc__o = doc._o
5528 if elem is None: elem__o = None
5529 else: elem__o = elem._o
5530 ret = libxml2mod.xmlRelaxNGValidateFullElement(self._o, doc__o, elem__o)
5531 return ret
5532
5533 def relaxNGValidatePopElement(self, doc, elem):
5534 """Pop the element end from the RelaxNG validation stack. """
5535 if doc is None: doc__o = None
5536 else: doc__o = doc._o
5537 if elem is None: elem__o = None
5538 else: elem__o = elem._o
5539 ret = libxml2mod.xmlRelaxNGValidatePopElement(self._o, doc__o, elem__o)
5540 return ret
5541
5542 def relaxNGValidatePushCData(self, data, len):
5543 """check the CData parsed for validation in the current stack """
5544 ret = libxml2mod.xmlRelaxNGValidatePushCData(self._o, data, len)
5545 return ret
5546
5547 def relaxNGValidatePushElement(self, doc, elem):
5548 """Push a new element start on the RelaxNG validation stack. """
5549 if doc is None: doc__o = None
5550 else: doc__o = doc._o
5551 if elem is None: elem__o = None
5552 else: elem__o = elem._o
5553 ret = libxml2mod.xmlRelaxNGValidatePushElement(self._o, doc__o, elem__o)
5554 return ret
5555
5556 #
5557 # relaxNgValidCtxt functions from module xmlreader
5558 #
5559
5560 def RelaxNGValidateCtxt(self, reader, options):
5561 """Use RelaxNG schema context to validate the document as it
5562 is processed. Activation is only possible before the first
5563 Read(). If @ctxt is None, then RelaxNG schema validation is
5564 deactivated. """
5565 if reader is None: reader__o = None
5566 else: reader__o = reader._o
5567 ret = libxml2mod.xmlTextReaderRelaxNGValidateCtxt(reader__o, self._o, options)
5568 return ret
5569
5570class SchemaParserCtxt:
5571 def __init__(self, _obj=None):
5572 if _obj != None:self._o = _obj;return
5573 self._o = None
5574
5575 def __del__(self):
5576 if self._o != None:
5577 libxml2mod.xmlSchemaFreeParserCtxt(self._o)
5578 self._o = None
5579
5580 #
5581 # SchemaParserCtxt functions from module xmlschemas
5582 #
5583
5584 def schemaParse(self):
5585 """parse a schema definition resource and build an internal
5586 XML Shema struture which can be used to validate instances. """
5587 ret = libxml2mod.xmlSchemaParse(self._o)
5588 if ret is None:raise parserError('xmlSchemaParse() failed')
5589 __tmp = Schema(_obj=ret)
5590 return __tmp
5591
5592class Schema:
5593 def __init__(self, _obj=None):
5594 if _obj != None:self._o = _obj;return
5595 self._o = None
5596
5597 def __del__(self):
5598 if self._o != None:
5599 libxml2mod.xmlSchemaFree(self._o)
5600 self._o = None
5601
5602 #
5603 # Schema functions from module xmlreader
5604 #
5605
5606 def SetSchema(self, reader):
5607 """Use XSD Schema to validate the document as it is processed.
5608 Activation is only possible before the first Read(). if
5609 @schema is None, then Schema validation is desactivated. @
5610 The @schema should not be freed until the reader is
5611 deallocated or its use has been deactivated. """
5612 if reader is None: reader__o = None
5613 else: reader__o = reader._o
5614 ret = libxml2mod.xmlTextReaderSetSchema(reader__o, self._o)
5615 return ret
5616
5617 #
5618 # Schema functions from module xmlschemas
5619 #
5620
5621 def schemaDump(self, output):
5622 """Dump a Schema structure. """
5623 libxml2mod.xmlSchemaDump(output, self._o)
5624
5625 def schemaNewValidCtxt(self):
5626 """Create an XML Schemas validation context based on the given
5627 schema. """
5628 ret = libxml2mod.xmlSchemaNewValidCtxt(self._o)
5629 if ret is None:raise treeError('xmlSchemaNewValidCtxt() failed')
5630 __tmp = SchemaValidCtxt(_obj=ret)
5631 __tmp.schema = self
5632 return __tmp
5633
5634class SchemaValidCtxt(SchemaValidCtxtCore):
5635 def __init__(self, _obj=None):
5636 self.schema = None
5637 self._o = _obj
5638 SchemaValidCtxtCore.__init__(self, _obj=_obj)
5639
5640 def __del__(self):
5641 if self._o != None:
5642 libxml2mod.xmlSchemaFreeValidCtxt(self._o)
5643 self._o = None
5644
5645 #
5646 # SchemaValidCtxt functions from module xmlreader
5647 #
5648
5649 def SchemaValidateCtxt(self, reader, options):
5650 """Use W3C XSD schema context to validate the document as it
5651 is processed. Activation is only possible before the first
5652 Read(). If @ctxt is None, then XML Schema validation is
5653 deactivated. """
5654 if reader is None: reader__o = None
5655 else: reader__o = reader._o
5656 ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(reader__o, self._o, options)
5657 return ret
5658
5659 #
5660 # SchemaValidCtxt functions from module xmlschemas
5661 #
5662
5663 def schemaIsValid(self):
5664 """Check if any error was detected during validation. """
5665 ret = libxml2mod.xmlSchemaIsValid(self._o)
5666 return ret
5667
5668 def schemaSetValidOptions(self, options):
5669 """Sets the options to be used during the validation. """
5670 ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options)
5671 return ret
5672
5673 def schemaValidCtxtGetOptions(self):
5674 """Get the validation context options. """
5675 ret = libxml2mod.xmlSchemaValidCtxtGetOptions(self._o)
5676 return ret
5677
5678 def schemaValidCtxtGetParserCtxt(self):
5679 """allow access to the parser context of the schema validation
5680 context """
5681 ret = libxml2mod.xmlSchemaValidCtxtGetParserCtxt(self._o)
5682 if ret is None:raise parserError('xmlSchemaValidCtxtGetParserCtxt() failed')
5683 __tmp = parserCtxt(_obj=ret)
5684 return __tmp
5685
5686 def schemaValidateDoc(self, doc):
5687 """Validate a document tree in memory. """
5688 if doc is None: doc__o = None
5689 else: doc__o = doc._o
5690 ret = libxml2mod.xmlSchemaValidateDoc(self._o, doc__o)
5691 return ret
5692
5693 def schemaValidateFile(self, filename, options):
5694 """Do a schemas validation of the given resource, it will use
5695 the SAX streamable validation internally. """
5696 ret = libxml2mod.xmlSchemaValidateFile(self._o, filename, options)
5697 return ret
5698
5699 def schemaValidateOneElement(self, elem):
5700 """Validate a branch of a tree, starting with the given @elem. """
5701 if elem is None: elem__o = None
5702 else: elem__o = elem._o
5703 ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o)
5704 return ret
5705
5706 def schemaValidateSetFilename(self, filename):
5707 """Workaround to provide file error reporting information when
5708 this is not provided by current APIs """
5709 libxml2mod.xmlSchemaValidateSetFilename(self._o, filename)
5710
5711class xmlTextReaderLocator:
5712 def __init__(self, _obj=None):
5713 if _obj != None:self._o = _obj;return
5714 self._o = None
5715
5716 #
5717 # xmlTextReaderLocator functions from module xmlreader
5718 #
5719
5720 def BaseURI(self):
5721 """Obtain the base URI for the given locator. """
5722 ret = libxml2mod.xmlTextReaderLocatorBaseURI(self._o)
5723 return ret
5724
5725 def LineNumber(self):
5726 """Obtain the line number for the given locator. """
5727 ret = libxml2mod.xmlTextReaderLocatorLineNumber(self._o)
5728 return ret
5729
5730class xmlTextReader(xmlTextReaderCore):
5731 def __init__(self, _obj=None):
5732 self.input = None
5733 self._o = _obj
5734 xmlTextReaderCore.__init__(self, _obj=_obj)
5735
5736 def __del__(self):
5737 if self._o != None:
5738 libxml2mod.xmlFreeTextReader(self._o)
5739 self._o = None
5740
5741 #
5742 # xmlTextReader functions from module xmlreader
5743 #
5744
5745 def AttributeCount(self):
5746 """Provides the number of attributes of the current node """
5747 ret = libxml2mod.xmlTextReaderAttributeCount(self._o)
5748 return ret
5749
5750 def BaseUri(self):
5751 """The base URI of the node. """
5752 ret = libxml2mod.xmlTextReaderConstBaseUri(self._o)
5753 return ret
5754
5755 def ByteConsumed(self):
5756 """This function provides the current index of the parser used
5757 by the reader, relative to the start of the current entity.
5758 This function actually just wraps a call to
5759 xmlBytesConsumed() for the parser context associated with
5760 the reader. See xmlBytesConsumed() for more information. """
5761 ret = libxml2mod.xmlTextReaderByteConsumed(self._o)
5762 return ret
5763
5764 def Close(self):
5765 """This method releases any resources allocated by the current
5766 instance changes the state to Closed and close any
5767 underlying input. """
5768 ret = libxml2mod.xmlTextReaderClose(self._o)
5769 return ret
5770
5771 def CurrentDoc(self):
5772 """Hacking interface allowing to get the xmlDocPtr
5773 correponding to the current document being accessed by the
5774 xmlTextReader. NOTE: as a result of this call, the reader
5775 will not destroy the associated XML document and calling
5776 xmlFreeDoc() on the result is needed once the reader
5777 parsing has finished. """
5778 ret = libxml2mod.xmlTextReaderCurrentDoc(self._o)
5779 if ret is None:raise treeError('xmlTextReaderCurrentDoc() failed')
5780 __tmp = xmlDoc(_obj=ret)
5781 return __tmp
5782
5783 def CurrentNode(self):
5784 """Hacking interface allowing to get the xmlNodePtr
5785 correponding to the current node being accessed by the
5786 xmlTextReader. This is dangerous because the underlying
5787 node may be destroyed on the next Reads. """
5788 ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
5789 if ret is None:raise treeError('xmlTextReaderCurrentNode() failed')
5790 __tmp = xmlNode(_obj=ret)
5791 return __tmp
5792
5793 def Depth(self):
5794 """The depth of the node in the tree. """
5795 ret = libxml2mod.xmlTextReaderDepth(self._o)
5796 return ret
5797
5798 def Encoding(self):
5799 """Determine the encoding of the document being read. """
5800 ret = libxml2mod.xmlTextReaderConstEncoding(self._o)
5801 return ret
5802
5803 def Expand(self):
5804 """Reads the contents of the current node and the full
5805 subtree. It then makes the subtree available until the next
5806 xmlTextReaderRead() call """
5807 ret = libxml2mod.xmlTextReaderExpand(self._o)
5808 if ret is None:raise treeError('xmlTextReaderExpand() failed')
5809 __tmp = xmlNode(_obj=ret)
5810 return __tmp
5811
5812 def GetAttribute(self, name):
5813 """Provides the value of the attribute with the specified
5814 qualified name. """
5815 ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
5816 return ret
5817
5818 def GetAttributeNo(self, no):
5819 """Provides the value of the attribute with the specified
5820 index relative to the containing element. """
5821 ret = libxml2mod.xmlTextReaderGetAttributeNo(self._o, no)
5822 return ret
5823
5824 def GetAttributeNs(self, localName, namespaceURI):
5825 """Provides the value of the specified attribute """
5826 ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI)
5827 return ret
5828
5829 def GetParserColumnNumber(self):
5830 """Provide the column number of the current parsing point. """
5831 ret = libxml2mod.xmlTextReaderGetParserColumnNumber(self._o)
5832 return ret
5833
5834 def GetParserLineNumber(self):
5835 """Provide the line number of the current parsing point. """
5836 ret = libxml2mod.xmlTextReaderGetParserLineNumber(self._o)
5837 return ret
5838
5839 def GetParserProp(self, prop):
5840 """Read the parser internal property. """
5841 ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop)
5842 return ret
5843
5844 def GetRemainder(self):
5845 """Method to get the remainder of the buffered XML. this
5846 method stops the parser, set its state to End Of File and
5847 return the input stream with what is left that the parser
5848 did not use. The implementation is not good, the parser
5849 certainly procgressed past what's left in reader->input,
5850 and there is an allocation problem. Best would be to
5851 rewrite it differently. """
5852 ret = libxml2mod.xmlTextReaderGetRemainder(self._o)
5853 if ret is None:raise treeError('xmlTextReaderGetRemainder() failed')
5854 __tmp = inputBuffer(_obj=ret)
5855 return __tmp
5856
5857 def HasAttributes(self):
5858 """Whether the node has attributes. """
5859 ret = libxml2mod.xmlTextReaderHasAttributes(self._o)
5860 return ret
5861
5862 def HasValue(self):
5863 """Whether the node can have a text value. """
5864 ret = libxml2mod.xmlTextReaderHasValue(self._o)
5865 return ret
5866
5867 def IsDefault(self):
5868 """Whether an Attribute node was generated from the default
5869 value defined in the DTD or schema. """
5870 ret = libxml2mod.xmlTextReaderIsDefault(self._o)
5871 return ret
5872
5873 def IsEmptyElement(self):
5874 """Check if the current node is empty """
5875 ret = libxml2mod.xmlTextReaderIsEmptyElement(self._o)
5876 return ret
5877
5878 def IsNamespaceDecl(self):
5879 """Determine whether the current node is a namespace
5880 declaration rather than a regular attribute. """
5881 ret = libxml2mod.xmlTextReaderIsNamespaceDecl(self._o)
5882 return ret
5883
5884 def IsValid(self):
5885 """Retrieve the validity status from the parser context """
5886 ret = libxml2mod.xmlTextReaderIsValid(self._o)
5887 return ret
5888
5889 def LocalName(self):
5890 """The local name of the node. """
5891 ret = libxml2mod.xmlTextReaderConstLocalName(self._o)
5892 return ret
5893
5894 def LookupNamespace(self, prefix):
5895 """Resolves a namespace prefix in the scope of the current
5896 element. """
5897 ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
5898 return ret
5899
5900 def MoveToAttribute(self, name):
5901 """Moves the position of the current instance to the attribute
5902 with the specified qualified name. """
5903 ret = libxml2mod.xmlTextReaderMoveToAttribute(self._o, name)
5904 return ret
5905
5906 def MoveToAttributeNo(self, no):
5907 """Moves the position of the current instance to the attribute
5908 with the specified index relative to the containing element. """
5909 ret = libxml2mod.xmlTextReaderMoveToAttributeNo(self._o, no)
5910 return ret
5911
5912 def MoveToAttributeNs(self, localName, namespaceURI):
5913 """Moves the position of the current instance to the attribute
5914 with the specified local name and namespace URI. """
5915 ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
5916 return ret
5917
5918 def MoveToElement(self):
5919 """Moves the position of the current instance to the node that
5920 contains the current Attribute node. """
5921 ret = libxml2mod.xmlTextReaderMoveToElement(self._o)
5922 return ret
5923
5924 def MoveToFirstAttribute(self):
5925 """Moves the position of the current instance to the first
5926 attribute associated with the current node. """
5927 ret = libxml2mod.xmlTextReaderMoveToFirstAttribute(self._o)
5928 return ret
5929
5930 def MoveToNextAttribute(self):
5931 """Moves the position of the current instance to the next
5932 attribute associated with the current node. """
5933 ret = libxml2mod.xmlTextReaderMoveToNextAttribute(self._o)
5934 return ret
5935
5936 def Name(self):
5937 """The qualified name of the node, equal to Prefix :LocalName. """
5938 ret = libxml2mod.xmlTextReaderConstName(self._o)
5939 return ret
5940
5941 def NamespaceUri(self):
5942 """The URI defining the namespace associated with the node. """
5943 ret = libxml2mod.xmlTextReaderConstNamespaceUri(self._o)
5944 return ret
5945
5946 def NewDoc(self, cur, URL, encoding, options):
5947 """Setup an xmltextReader to parse an XML in-memory document.
5948 The parsing flags @options are a combination of
5949 xmlParserOption. This reuses the existing @reader
5950 xmlTextReader. """
5951 ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options)
5952 return ret
5953
5954 def NewFd(self, fd, URL, encoding, options):
5955 """Setup an xmltextReader to parse an XML from a file
5956 descriptor. NOTE that the file descriptor will not be
5957 closed when the reader is closed or reset. The parsing
5958 flags @options are a combination of xmlParserOption. This
5959 reuses the existing @reader xmlTextReader. """
5960 ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options)
5961 return ret
5962
5963 def NewFile(self, filename, encoding, options):
5964 """parse an XML file from the filesystem or the network. The
5965 parsing flags @options are a combination of
5966 xmlParserOption. This reuses the existing @reader
5967 xmlTextReader. """
5968 ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options)
5969 return ret
5970
5971 def NewMemory(self, buffer, size, URL, encoding, options):
5972 """Setup an xmltextReader to parse an XML in-memory document.
5973 The parsing flags @options are a combination of
5974 xmlParserOption. This reuses the existing @reader
5975 xmlTextReader. """
5976 ret = libxml2mod.xmlReaderNewMemory(self._o, buffer, size, URL, encoding, options)
5977 return ret
5978
5979 def NewWalker(self, doc):
5980 """Setup an xmltextReader to parse a preparsed XML document.
5981 This reuses the existing @reader xmlTextReader. """
5982 if doc is None: doc__o = None
5983 else: doc__o = doc._o
5984 ret = libxml2mod.xmlReaderNewWalker(self._o, doc__o)
5985 return ret
5986
5987 def Next(self):
5988 """Skip to the node following the current one in document
5989 order while avoiding the subtree if any. """
5990 ret = libxml2mod.xmlTextReaderNext(self._o)
5991 return ret
5992
5993 def NextSibling(self):
5994 """Skip to the node following the current one in document
5995 order while avoiding the subtree if any. Currently
5996 implemented only for Readers built on a document """
5997 ret = libxml2mod.xmlTextReaderNextSibling(self._o)
5998 return ret
5999
6000 def NodeType(self):
6001 """Get the node type of the current node Reference:
6002 http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
6003 lNodeType.html """
6004 ret = libxml2mod.xmlTextReaderNodeType(self._o)
6005 return ret
6006
6007 def Normalization(self):
6008 """The value indicating whether to normalize white space and
6009 attribute values. Since attribute value and end of line
6010 normalizations are a MUST in the XML specification only the
6011 value true is accepted. The broken bahaviour of accepting
6012 out of range character entities like &#0; is of course not
6013 supported either. """
6014 ret = libxml2mod.xmlTextReaderNormalization(self._o)
6015 return ret
6016
6017 def Prefix(self):
6018 """A shorthand reference to the namespace associated with the
6019 node. """
6020 ret = libxml2mod.xmlTextReaderConstPrefix(self._o)
6021 return ret
6022
6023 def Preserve(self):
6024 """This tells the XML Reader to preserve the current node. The
6025 caller must also use xmlTextReaderCurrentDoc() to keep an
6026 handle on the resulting document once parsing has finished """
6027 ret = libxml2mod.xmlTextReaderPreserve(self._o)
6028 if ret is None:raise treeError('xmlTextReaderPreserve() failed')
6029 __tmp = xmlNode(_obj=ret)
6030 return __tmp
6031
6032 def QuoteChar(self):
6033 """The quotation mark character used to enclose the value of
6034 an attribute. """
6035 ret = libxml2mod.xmlTextReaderQuoteChar(self._o)
6036 return ret
6037
6038 def Read(self):
6039 """Moves the position of the current instance to the next node
6040 in the stream, exposing its properties. """
6041 ret = libxml2mod.xmlTextReaderRead(self._o)
6042 return ret
6043
6044 def ReadAttributeValue(self):
6045 """Parses an attribute value into one or more Text and
6046 EntityReference nodes. """
6047 ret = libxml2mod.xmlTextReaderReadAttributeValue(self._o)
6048 return ret
6049
6050 def ReadInnerXml(self):
6051 """Reads the contents of the current node, including child
6052 nodes and markup. """
6053 ret = libxml2mod.xmlTextReaderReadInnerXml(self._o)
6054 return ret
6055
6056 def ReadOuterXml(self):
6057 """Reads the contents of the current node, including child
6058 nodes and markup. """
6059 ret = libxml2mod.xmlTextReaderReadOuterXml(self._o)
6060 return ret
6061
6062 def ReadState(self):
6063 """Gets the read state of the reader. """
6064 ret = libxml2mod.xmlTextReaderReadState(self._o)
6065 return ret
6066
6067 def ReadString(self):
6068 """Reads the contents of an element or a text node as a string. """
6069 ret = libxml2mod.xmlTextReaderReadString(self._o)
6070 return ret
6071
6072 def RelaxNGSetSchema(self, schema):
6073 """Use RelaxNG to validate the document as it is processed.
6074 Activation is only possible before the first Read(). if
6075 @schema is None, then RelaxNG validation is desactivated. @
6076 The @schema should not be freed until the reader is
6077 deallocated or its use has been deactivated. """
6078 if schema is None: schema__o = None
6079 else: schema__o = schema._o
6080 ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(self._o, schema__o)
6081 return ret
6082
6083 def RelaxNGValidate(self, rng):
6084 """Use RelaxNG schema to validate the document as it is
6085 processed. Activation is only possible before the first
6086 Read(). If @rng is None, then RelaxNG schema validation is
6087 deactivated. """
6088 ret = libxml2mod.xmlTextReaderRelaxNGValidate(self._o, rng)
6089 return ret
6090
6091 def RelaxNGValidateCtxt(self, ctxt, options):
6092 """Use RelaxNG schema context to validate the document as it
6093 is processed. Activation is only possible before the first
6094 Read(). If @ctxt is None, then RelaxNG schema validation is
6095 deactivated. """
6096 if ctxt is None: ctxt__o = None
6097 else: ctxt__o = ctxt._o
6098 ret = libxml2mod.xmlTextReaderRelaxNGValidateCtxt(self._o, ctxt__o, options)
6099 return ret
6100
6101 def SchemaValidate(self, xsd):
6102 """Use W3C XSD schema to validate the document as it is
6103 processed. Activation is only possible before the first
6104 Read(). If @xsd is None, then XML Schema validation is
6105 deactivated. """
6106 ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd)
6107 return ret
6108
6109 def SchemaValidateCtxt(self, ctxt, options):
6110 """Use W3C XSD schema context to validate the document as it
6111 is processed. Activation is only possible before the first
6112 Read(). If @ctxt is None, then XML Schema validation is
6113 deactivated. """
6114 if ctxt is None: ctxt__o = None
6115 else: ctxt__o = ctxt._o
6116 ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(self._o, ctxt__o, options)
6117 return ret
6118
6119 def SetParserProp(self, prop, value):
6120 """Change the parser processing behaviour by changing some of
6121 its internal properties. Note that some properties can only
6122 be changed before any read has been done. """
6123 ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value)
6124 return ret
6125
6126 def SetSchema(self, schema):
6127 """Use XSD Schema to validate the document as it is processed.
6128 Activation is only possible before the first Read(). if
6129 @schema is None, then Schema validation is desactivated. @
6130 The @schema should not be freed until the reader is
6131 deallocated or its use has been deactivated. """
6132 if schema is None: schema__o = None
6133 else: schema__o = schema._o
6134 ret = libxml2mod.xmlTextReaderSetSchema(self._o, schema__o)
6135 return ret
6136
6137 def Setup(self, input, URL, encoding, options):
6138 """Setup an XML reader with new options """
6139 if input is None: input__o = None
6140 else: input__o = input._o
6141 ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options)
6142 return ret
6143
6144 def Standalone(self):
6145 """Determine the standalone status of the document being read. """
6146 ret = libxml2mod.xmlTextReaderStandalone(self._o)
6147 return ret
6148
6149 def String(self, str):
6150 """Get an interned string from the reader, allows for example
6151 to speedup string name comparisons """
6152 ret = libxml2mod.xmlTextReaderConstString(self._o, str)
6153 return ret
6154
6155 def Value(self):
6156 """Provides the text value of the node if present """
6157 ret = libxml2mod.xmlTextReaderConstValue(self._o)
6158 return ret
6159
6160 def XmlLang(self):
6161 """The xml:lang scope within which the node resides. """
6162 ret = libxml2mod.xmlTextReaderConstXmlLang(self._o)
6163 return ret
6164
6165 def XmlVersion(self):
6166 """Determine the XML version of the document being read. """
6167 ret = libxml2mod.xmlTextReaderConstXmlVersion(self._o)
6168 return ret
6169
6170class URI:
6171 def __init__(self, _obj=None):
6172 if _obj != None:self._o = _obj;return
6173 self._o = None
6174
6175 def __del__(self):
6176 if self._o != None:
6177 libxml2mod.xmlFreeURI(self._o)
6178 self._o = None
6179
6180 # accessors for URI
6181 def authority(self):
6182 """Get the authority part from an URI """
6183 ret = libxml2mod.xmlURIGetAuthority(self._o)
6184 return ret
6185
6186 def fragment(self):
6187 """Get the fragment part from an URI """
6188 ret = libxml2mod.xmlURIGetFragment(self._o)
6189 return ret
6190
6191 def opaque(self):
6192 """Get the opaque part from an URI """
6193 ret = libxml2mod.xmlURIGetOpaque(self._o)
6194 return ret
6195
6196 def path(self):
6197 """Get the path part from an URI """
6198 ret = libxml2mod.xmlURIGetPath(self._o)
6199 return ret
6200
6201 def port(self):
6202 """Get the port part from an URI """
6203 ret = libxml2mod.xmlURIGetPort(self._o)
6204 return ret
6205
6206 def query(self):
6207 """Get the query part from an URI """
6208 ret = libxml2mod.xmlURIGetQuery(self._o)
6209 return ret
6210
6211 def queryRaw(self):
6212 """Get the raw query part from an URI (i.e. the unescaped
6213 form). """
6214 ret = libxml2mod.xmlURIGetQueryRaw(self._o)
6215 return ret
6216
6217 def scheme(self):
6218 """Get the scheme part from an URI """
6219 ret = libxml2mod.xmlURIGetScheme(self._o)
6220 return ret
6221
6222 def server(self):
6223 """Get the server part from an URI """
6224 ret = libxml2mod.xmlURIGetServer(self._o)
6225 return ret
6226
6227 def setAuthority(self, authority):
6228 """Set the authority part of an URI. """
6229 libxml2mod.xmlURISetAuthority(self._o, authority)
6230
6231 def setFragment(self, fragment):
6232 """Set the fragment part of an URI. """
6233 libxml2mod.xmlURISetFragment(self._o, fragment)
6234
6235 def setOpaque(self, opaque):
6236 """Set the opaque part of an URI. """
6237 libxml2mod.xmlURISetOpaque(self._o, opaque)
6238
6239 def setPath(self, path):
6240 """Set the path part of an URI. """
6241 libxml2mod.xmlURISetPath(self._o, path)
6242
6243 def setPort(self, port):
6244 """Set the port part of an URI. """
6245 libxml2mod.xmlURISetPort(self._o, port)
6246
6247 def setQuery(self, query):
6248 """Set the query part of an URI. """
6249 libxml2mod.xmlURISetQuery(self._o, query)
6250
6251 def setQueryRaw(self, query_raw):
6252 """Set the raw query part of an URI (i.e. the unescaped form). """
6253 libxml2mod.xmlURISetQueryRaw(self._o, query_raw)
6254
6255 def setScheme(self, scheme):
6256 """Set the scheme part of an URI. """
6257 libxml2mod.xmlURISetScheme(self._o, scheme)
6258
6259 def setServer(self, server):
6260 """Set the server part of an URI. """
6261 libxml2mod.xmlURISetServer(self._o, server)
6262
6263 def setUser(self, user):
6264 """Set the user part of an URI. """
6265 libxml2mod.xmlURISetUser(self._o, user)
6266
6267 def user(self):
6268 """Get the user part from an URI """
6269 ret = libxml2mod.xmlURIGetUser(self._o)
6270 return ret
6271
6272 #
6273 # URI functions from module uri
6274 #
6275
6276 def parseURIReference(self, str):
6277 """Parse an URI reference string based on RFC 3986 and fills
6278 in the appropriate fields of the @uri structure
6279 URI-reference = URI / relative-ref """
6280 ret = libxml2mod.xmlParseURIReference(self._o, str)
6281 return ret
6282
6283 def printURI(self, stream):
6284 """Prints the URI in the stream @stream. """
6285 libxml2mod.xmlPrintURI(stream, self._o)
6286
6287 def saveUri(self):
6288 """Save the URI as an escaped string """
6289 ret = libxml2mod.xmlSaveUri(self._o)
6290 return ret
6291
6292class ValidCtxt(ValidCtxtCore):
6293 def __init__(self, _obj=None):
6294 self._o = _obj
6295 ValidCtxtCore.__init__(self, _obj=_obj)
6296
6297 def __del__(self):
6298 if self._o != None:
6299 libxml2mod.xmlFreeValidCtxt(self._o)
6300 self._o = None
6301
6302 #
6303 # ValidCtxt functions from module valid
6304 #
6305
6306 def validCtxtNormalizeAttributeValue(self, doc, elem, name, value):
6307 """Does the validation related extra step of the normalization
6308 of attribute values: If the declared value is not CDATA,
6309 then the XML processor must further process the normalized
6310 attribute value by discarding any leading and trailing
6311 space (#x20) characters, and by replacing sequences of
6312 space (#x20) characters by single space (#x20) character.
6313 Also check VC: Standalone Document Declaration in P32, and
6314 update ctxt->valid accordingly """
6315 if doc is None: doc__o = None
6316 else: doc__o = doc._o
6317 if elem is None: elem__o = None
6318 else: elem__o = elem._o
6319 ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(self._o, doc__o, elem__o, name, value)
6320 return ret
6321
6322 def validateDocument(self, doc):
6323 """Try to validate the document instance basically it does
6324 the all the checks described by the XML Rec i.e. validates
6325 the internal and external subset (if present) and validate
6326 the document tree. """
6327 if doc is None: doc__o = None
6328 else: doc__o = doc._o
6329 ret = libxml2mod.xmlValidateDocument(self._o, doc__o)
6330 return ret
6331
6332 def validateDocumentFinal(self, doc):
6333 """Does the final step for the document validation once all
6334 the incremental validation steps have been completed
6335 basically it does the following checks described by the XML
6336 Rec Check all the IDREF/IDREFS attributes definition for
6337 validity """
6338 if doc is None: doc__o = None
6339 else: doc__o = doc._o
6340 ret = libxml2mod.xmlValidateDocumentFinal(self._o, doc__o)
6341 return ret
6342
6343 def validateDtd(self, doc, dtd):
6344 """Try to validate the document against the dtd instance
6345 Basically it does check all the definitions in the DtD.
6346 Note the the internal subset (if present) is de-coupled
6347 (i.e. not used), which could give problems if ID or IDREF
6348 is present. """
6349 if doc is None: doc__o = None
6350 else: doc__o = doc._o
6351 if dtd is None: dtd__o = None
6352 else: dtd__o = dtd._o
6353 ret = libxml2mod.xmlValidateDtd(self._o, doc__o, dtd__o)
6354 return ret
6355
6356 def validateDtdFinal(self, doc):
6357 """Does the final step for the dtds validation once all the
6358 subsets have been parsed basically it does the following
6359 checks described by the XML Rec - check that ENTITY and
6360 ENTITIES type attributes default or possible values matches
6361 one of the defined entities. - check that NOTATION type
6362 attributes default or possible values matches one of the
6363 defined notations. """
6364 if doc is None: doc__o = None
6365 else: doc__o = doc._o
6366 ret = libxml2mod.xmlValidateDtdFinal(self._o, doc__o)
6367 return ret
6368
6369 def validateElement(self, doc, elem):
6370 """Try to validate the subtree under an element """
6371 if doc is None: doc__o = None
6372 else: doc__o = doc._o
6373 if elem is None: elem__o = None
6374 else: elem__o = elem._o
6375 ret = libxml2mod.xmlValidateElement(self._o, doc__o, elem__o)
6376 return ret
6377
6378 def validateNotationUse(self, doc, notationName):
6379 """Validate that the given name match a notation declaration.
6380 - [ VC: Notation Declared ] """
6381 if doc is None: doc__o = None
6382 else: doc__o = doc._o
6383 ret = libxml2mod.xmlValidateNotationUse(self._o, doc__o, notationName)
6384 return ret
6385
6386 def validateOneAttribute(self, doc, elem, attr, value):
6387 """Try to validate a single attribute for an element basically
6388 it does the following checks as described by the XML-1.0
6389 recommendation: - [ VC: Attribute Value Type ] - [ VC:
6390 Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
6391 Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity
6392 Name ] - [ VC: Notation Attributes ] The ID/IDREF
6393 uniqueness and matching are done separately """
6394 if doc is None: doc__o = None
6395 else: doc__o = doc._o
6396 if elem is None: elem__o = None
6397 else: elem__o = elem._o
6398 if attr is None: attr__o = None
6399 else: attr__o = attr._o
6400 ret = libxml2mod.xmlValidateOneAttribute(self._o, doc__o, elem__o, attr__o, value)
6401 return ret
6402
6403 def validateOneElement(self, doc, elem):
6404 """Try to validate a single element and it's attributes,
6405 basically it does the following checks as described by the
6406 XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
6407 Required Attribute ] Then call xmlValidateOneAttribute()
6408 for each attribute present. The ID/IDREF checkings are
6409 done separately """
6410 if doc is None: doc__o = None
6411 else: doc__o = doc._o
6412 if elem is None: elem__o = None
6413 else: elem__o = elem._o
6414 ret = libxml2mod.xmlValidateOneElement(self._o, doc__o, elem__o)
6415 return ret
6416
6417 def validateOneNamespace(self, doc, elem, prefix, ns, value):
6418 """Try to validate a single namespace declaration for an
6419 element basically it does the following checks as described
6420 by the XML-1.0 recommendation: - [ VC: Attribute Value Type
6421 ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
6422 [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC:
6423 Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF
6424 uniqueness and matching are done separately """
6425 if doc is None: doc__o = None
6426 else: doc__o = doc._o
6427 if elem is None: elem__o = None
6428 else: elem__o = elem._o
6429 if ns is None: ns__o = None
6430 else: ns__o = ns._o
6431 ret = libxml2mod.xmlValidateOneNamespace(self._o, doc__o, elem__o, prefix, ns__o, value)
6432 return ret
6433
6434 def validatePopElement(self, doc, elem, qname):
6435 """Pop the element end from the validation stack. """
6436 if doc is None: doc__o = None
6437 else: doc__o = doc._o
6438 if elem is None: elem__o = None
6439 else: elem__o = elem._o
6440 ret = libxml2mod.xmlValidatePopElement(self._o, doc__o, elem__o, qname)
6441 return ret
6442
6443 def validatePushCData(self, data, len):
6444 """check the CData parsed for validation in the current stack """
6445 ret = libxml2mod.xmlValidatePushCData(self._o, data, len)
6446 return ret
6447
6448 def validatePushElement(self, doc, elem, qname):
6449 """Push a new element start on the validation stack. """
6450 if doc is None: doc__o = None
6451 else: doc__o = doc._o
6452 if elem is None: elem__o = None
6453 else: elem__o = elem._o
6454 ret = libxml2mod.xmlValidatePushElement(self._o, doc__o, elem__o, qname)
6455 return ret
6456
6457 def validateRoot(self, doc):
6458 """Try to validate a the root element basically it does the
6459 following check as described by the XML-1.0 recommendation:
6460 - [ VC: Root Element Type ] it doesn't try to recurse or
6461 apply other check to the element """
6462 if doc is None: doc__o = None
6463 else: doc__o = doc._o
6464 ret = libxml2mod.xmlValidateRoot(self._o, doc__o)
6465 return ret
6466
6467class xpathContext:
6468 def __init__(self, _obj=None):
6469 if _obj != None:self._o = _obj;return
6470 self._o = None
6471
6472 # accessors for xpathContext
6473 def contextDoc(self):
6474 """Get the doc from an xpathContext """
6475 ret = libxml2mod.xmlXPathGetContextDoc(self._o)
6476 if ret is None:raise xpathError('xmlXPathGetContextDoc() failed')
6477 __tmp = xmlDoc(_obj=ret)
6478 return __tmp
6479
6480 def contextNode(self):
6481 """Get the current node from an xpathContext """
6482 ret = libxml2mod.xmlXPathGetContextNode(self._o)
6483 if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
6484 __tmp = xmlNode(_obj=ret)
6485 return __tmp
6486
6487 def contextPosition(self):
6488 """Get the current node from an xpathContext """
6489 ret = libxml2mod.xmlXPathGetContextPosition(self._o)
6490 return ret
6491
6492 def contextSize(self):
6493 """Get the current node from an xpathContext """
6494 ret = libxml2mod.xmlXPathGetContextSize(self._o)
6495 return ret
6496
6497 def function(self):
6498 """Get the current function name xpathContext """
6499 ret = libxml2mod.xmlXPathGetFunction(self._o)
6500 return ret
6501
6502 def functionURI(self):
6503 """Get the current function name URI xpathContext """
6504 ret = libxml2mod.xmlXPathGetFunctionURI(self._o)
6505 return ret
6506
6507 def setContextDoc(self, doc):
6508 """Set the doc of an xpathContext """
6509 if doc is None: doc__o = None
6510 else: doc__o = doc._o
6511 libxml2mod.xmlXPathSetContextDoc(self._o, doc__o)
6512
6513 def setContextNode(self, node):
6514 """Set the current node of an xpathContext """
6515 if node is None: node__o = None
6516 else: node__o = node._o
6517 libxml2mod.xmlXPathSetContextNode(self._o, node__o)
6518
6519 #
6520 # xpathContext functions from module python
6521 #
6522
6523 def registerXPathFunction(self, name, ns_uri, f):
6524 """Register a Python written function to the XPath interpreter """
6525 ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
6526 return ret
6527
6528 def xpathRegisterVariable(self, name, ns_uri, value):
6529 """Register a variable with the XPath context """
6530 ret = libxml2mod.xmlXPathRegisterVariable(self._o, name, ns_uri, value)
6531 return ret
6532
6533 #
6534 # xpathContext functions from module xpath
6535 #
6536
6537 def xpathContextSetCache(self, active, value, options):
6538 """Creates/frees an object cache on the XPath context. If
6539 activates XPath objects (xmlXPathObject) will be cached
6540 internally to be reused. @options: 0: This will set the
6541 XPath object caching: @value: This will set the maximum
6542 number of XPath objects to be cached per slot There are 5
6543 slots for: node-set, string, number, boolean, and misc
6544 objects. Use <0 for the default number (100). Other values
6545 for @options have currently no effect. """
6546 ret = libxml2mod.xmlXPathContextSetCache(self._o, active, value, options)
6547 return ret
6548
6549 def xpathEval(self, str):
6550 """Evaluate the XPath Location Path in the given context. """
6551 ret = libxml2mod.xmlXPathEval(str, self._o)
6552 if ret is None:raise xpathError('xmlXPathEval() failed')
6553 return xpathObjectRet(ret)
6554
6555 def xpathEvalExpression(self, str):
6556 """Evaluate the XPath expression in the given context. """
6557 ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
6558 if ret is None:raise xpathError('xmlXPathEvalExpression() failed')
6559 return xpathObjectRet(ret)
6560
6561 def xpathFreeContext(self):
6562 """Free up an xmlXPathContext """
6563 libxml2mod.xmlXPathFreeContext(self._o)
6564
6565 #
6566 # xpathContext functions from module xpathInternals
6567 #
6568
6569 def xpathNewParserContext(self, str):
6570 """Create a new xmlXPathParserContext """
6571 ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
6572 if ret is None:raise xpathError('xmlXPathNewParserContext() failed')
6573 __tmp = xpathParserContext(_obj=ret)
6574 return __tmp
6575
6576 def xpathNsLookup(self, prefix):
6577 """Search in the namespace declaration array of the context
6578 for the given namespace name associated to the given prefix """
6579 ret = libxml2mod.xmlXPathNsLookup(self._o, prefix)
6580 return ret
6581
6582 def xpathRegisterAllFunctions(self):
6583 """Registers all default XPath functions in this context """
6584 libxml2mod.xmlXPathRegisterAllFunctions(self._o)
6585
6586 def xpathRegisterNs(self, prefix, ns_uri):
6587 """Register a new namespace. If @ns_uri is None it unregisters
6588 the namespace """
6589 ret = libxml2mod.xmlXPathRegisterNs(self._o, prefix, ns_uri)
6590 return ret
6591
6592 def xpathRegisteredFuncsCleanup(self):
6593 """Cleanup the XPath context data associated to registered
6594 functions """
6595 libxml2mod.xmlXPathRegisteredFuncsCleanup(self._o)
6596
6597 def xpathRegisteredNsCleanup(self):
6598 """Cleanup the XPath context data associated to registered
6599 variables """
6600 libxml2mod.xmlXPathRegisteredNsCleanup(self._o)
6601
6602 def xpathRegisteredVariablesCleanup(self):
6603 """Cleanup the XPath context data associated to registered
6604 variables """
6605 libxml2mod.xmlXPathRegisteredVariablesCleanup(self._o)
6606
6607 def xpathVariableLookup(self, name):
6608 """Search in the Variable array of the context for the given
6609 variable value. """
6610 ret = libxml2mod.xmlXPathVariableLookup(self._o, name)
6611 if ret is None:raise xpathError('xmlXPathVariableLookup() failed')
6612 return xpathObjectRet(ret)
6613
6614 def xpathVariableLookupNS(self, name, ns_uri):
6615 """Search in the Variable array of the context for the given
6616 variable value. """
6617 ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri)
6618 if ret is None:raise xpathError('xmlXPathVariableLookupNS() failed')
6619 return xpathObjectRet(ret)
6620
6621 #
6622 # xpathContext functions from module xpointer
6623 #
6624
6625 def xpointerEval(self, str):
6626 """Evaluate the XPath Location Path in the given context. """
6627 ret = libxml2mod.xmlXPtrEval(str, self._o)
6628 if ret is None:raise treeError('xmlXPtrEval() failed')
6629 return xpathObjectRet(ret)
6630
6631class xpathParserContext:
6632 def __init__(self, _obj=None):
6633 if _obj != None:self._o = _obj;return
6634 self._o = None
6635
6636 # accessors for xpathParserContext
6637 def context(self):
6638 """Get the xpathContext from an xpathParserContext """
6639 ret = libxml2mod.xmlXPathParserGetContext(self._o)
6640 if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
6641 __tmp = xpathContext(_obj=ret)
6642 return __tmp
6643
6644 #
6645 # xpathParserContext functions from module xpathInternals
6646 #
6647
6648 def xpathAddValues(self):
6649 """Implement the add operation on XPath objects: The numeric
6650 operators convert their operands to numbers as if by
6651 calling the number function. """
6652 libxml2mod.xmlXPathAddValues(self._o)
6653
6654 def xpathBooleanFunction(self, nargs):
6655 """Implement the boolean() XPath function boolean
6656 boolean(object) The boolean function converts its argument
6657 to a boolean as follows: - a number is true if and only if
6658 it is neither positive or negative zero nor NaN - a
6659 node-set is true if and only if it is non-empty - a string
6660 is true if and only if its length is non-zero """
6661 libxml2mod.xmlXPathBooleanFunction(self._o, nargs)
6662
6663 def xpathCeilingFunction(self, nargs):
6664 """Implement the ceiling() XPath function number
6665 ceiling(number) The ceiling function returns the smallest
6666 (closest to negative infinity) number that is not less than
6667 the argument and that is an integer. """
6668 libxml2mod.xmlXPathCeilingFunction(self._o, nargs)
6669
6670 def xpathCompareValues(self, inf, strict):
6671 """Implement the compare operation on XPath objects: @arg1 <
6672 @arg2 (1, 1, ... @arg1 <= @arg2 (1, 0, ... @arg1 >
6673 @arg2 (0, 1, ... @arg1 >= @arg2 (0, 0, ... When
6674 neither object to be compared is a node-set and the
6675 operator is <=, <, >=, >, then the objects are compared by
6676 converted both objects to numbers and comparing the numbers
6677 according to IEEE 754. The < comparison will be true if and
6678 only if the first number is less than the second number.
6679 The <= comparison will be true if and only if the first
6680 number is less than or equal to the second number. The >
6681 comparison will be true if and only if the first number is
6682 greater than the second number. The >= comparison will be
6683 true if and only if the first number is greater than or
6684 equal to the second number. """
6685 ret = libxml2mod.xmlXPathCompareValues(self._o, inf, strict)
6686 return ret
6687
6688 def xpathConcatFunction(self, nargs):
6689 """Implement the concat() XPath function string concat(string,
6690 string, string*) The concat function returns the
6691 concatenation of its arguments. """
6692 libxml2mod.xmlXPathConcatFunction(self._o, nargs)
6693
6694 def xpathContainsFunction(self, nargs):
6695 """Implement the contains() XPath function boolean
6696 contains(string, string) The contains function returns true
6697 if the first argument string contains the second argument
6698 string, and otherwise returns false. """
6699 libxml2mod.xmlXPathContainsFunction(self._o, nargs)
6700
6701 def xpathCountFunction(self, nargs):
6702 """Implement the count() XPath function number count(node-set) """
6703 libxml2mod.xmlXPathCountFunction(self._o, nargs)
6704
6705 def xpathDivValues(self):
6706 """Implement the div operation on XPath objects @arg1 / @arg2:
6707 The numeric operators convert their operands to numbers as
6708 if by calling the number function. """
6709 libxml2mod.xmlXPathDivValues(self._o)
6710
6711 def xpathEqualValues(self):
6712 """Implement the equal operation on XPath objects content:
6713 @arg1 == @arg2 """
6714 ret = libxml2mod.xmlXPathEqualValues(self._o)
6715 return ret
6716
6717 def xpathErr(self, error):
6718 """Handle an XPath error """
6719 libxml2mod.xmlXPathErr(self._o, error)
6720
6721 def xpathEvalExpr(self):
6722 """Parse and evaluate an XPath expression in the given
6723 context, then push the result on the context stack """
6724 libxml2mod.xmlXPathEvalExpr(self._o)
6725
6726 def xpathFalseFunction(self, nargs):
6727 """Implement the false() XPath function boolean false() """
6728 libxml2mod.xmlXPathFalseFunction(self._o, nargs)
6729
6730 def xpathFloorFunction(self, nargs):
6731 """Implement the floor() XPath function number floor(number)
6732 The floor function returns the largest (closest to positive
6733 infinity) number that is not greater than the argument and
6734 that is an integer. """
6735 libxml2mod.xmlXPathFloorFunction(self._o, nargs)
6736
6737 def xpathFreeParserContext(self):
6738 """Free up an xmlXPathParserContext """
6739 libxml2mod.xmlXPathFreeParserContext(self._o)
6740
6741 def xpathIdFunction(self, nargs):
6742 """Implement the id() XPath function node-set id(object) The
6743 id function selects elements by their unique ID (see [5.2.1
6744 Unique IDs]). When the argument to id is of type node-set,
6745 then the result is the union of the result of applying id
6746 to the string value of each of the nodes in the argument
6747 node-set. When the argument to id is of any other type, the
6748 argument is converted to a string as if by a call to the
6749 string function; the string is split into a
6750 whitespace-separated list of tokens (whitespace is any
6751 sequence of characters matching the production S); the
6752 result is a node-set containing the elements in the same
6753 document as the context node that have a unique ID equal to
6754 any of the tokens in the list. """
6755 libxml2mod.xmlXPathIdFunction(self._o, nargs)
6756
6757 def xpathLangFunction(self, nargs):
6758 """Implement the lang() XPath function boolean lang(string)
6759 The lang function returns true or false depending on
6760 whether the language of the context node as specified by
6761 xml:lang attributes is the same as or is a sublanguage of
6762 the language specified by the argument string. The language
6763 of the context node is determined by the value of the
6764 xml:lang attribute on the context node, or, if the context
6765 node has no xml:lang attribute, by the value of the
6766 xml:lang attribute on the nearest ancestor of the context
6767 node that has an xml:lang attribute. If there is no such
6768 attribute, then lang """
6769 libxml2mod.xmlXPathLangFunction(self._o, nargs)
6770
6771 def xpathLastFunction(self, nargs):
6772 """Implement the last() XPath function number last() The last
6773 function returns the number of nodes in the context node
6774 list. """
6775 libxml2mod.xmlXPathLastFunction(self._o, nargs)
6776
6777 def xpathLocalNameFunction(self, nargs):
6778 """Implement the local-name() XPath function string
6779 local-name(node-set?) The local-name function returns a
6780 string containing the local part of the name of the node in
6781 the argument node-set that is first in document order. If
6782 the node-set is empty or the first node has no name, an
6783 empty string is returned. If the argument is omitted it
6784 defaults to the context node. """
6785 libxml2mod.xmlXPathLocalNameFunction(self._o, nargs)
6786
6787 def xpathModValues(self):
6788 """Implement the mod operation on XPath objects: @arg1 / @arg2
6789 The numeric operators convert their operands to numbers as
6790 if by calling the number function. """
6791 libxml2mod.xmlXPathModValues(self._o)
6792
6793 def xpathMultValues(self):
6794 """Implement the multiply operation on XPath objects: The
6795 numeric operators convert their operands to numbers as if
6796 by calling the number function. """
6797 libxml2mod.xmlXPathMultValues(self._o)
6798
6799 def xpathNamespaceURIFunction(self, nargs):
6800 """Implement the namespace-uri() XPath function string
6801 namespace-uri(node-set?) The namespace-uri function returns
6802 a string containing the namespace URI of the expanded name
6803 of the node in the argument node-set that is first in
6804 document order. If the node-set is empty, the first node
6805 has no name, or the expanded name has no namespace URI, an
6806 empty string is returned. If the argument is omitted it
6807 defaults to the context node. """
6808 libxml2mod.xmlXPathNamespaceURIFunction(self._o, nargs)
6809
6810 def xpathNextAncestor(self, cur):
6811 """Traversal function for the "ancestor" direction the
6812 ancestor axis contains the ancestors of the context node;
6813 the ancestors of the context node consist of the parent of
6814 context node and the parent's parent and so on; the nodes
6815 are ordered in reverse document order; thus the parent is
6816 the first node on the axis, and the parent's parent is the
6817 second node on the axis """
6818 if cur is None: cur__o = None
6819 else: cur__o = cur._o
6820 ret = libxml2mod.xmlXPathNextAncestor(self._o, cur__o)
6821 if ret is None:raise xpathError('xmlXPathNextAncestor() failed')
6822 __tmp = xmlNode(_obj=ret)
6823 return __tmp
6824
6825 def xpathNextAncestorOrSelf(self, cur):
6826 """Traversal function for the "ancestor-or-self" direction he
6827 ancestor-or-self axis contains the context node and
6828 ancestors of the context node in reverse document order;
6829 thus the context node is the first node on the axis, and
6830 the context node's parent the second; parent here is
6831 defined the same as with the parent axis. """
6832 if cur is None: cur__o = None
6833 else: cur__o = cur._o
6834 ret = libxml2mod.xmlXPathNextAncestorOrSelf(self._o, cur__o)
6835 if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed')
6836 __tmp = xmlNode(_obj=ret)
6837 return __tmp
6838
6839 def xpathNextAttribute(self, cur):
6840 """Traversal function for the "attribute" direction TODO:
6841 support DTD inherited default attributes """
6842 if cur is None: cur__o = None
6843 else: cur__o = cur._o
6844 ret = libxml2mod.xmlXPathNextAttribute(self._o, cur__o)
6845 if ret is None:raise xpathError('xmlXPathNextAttribute() failed')
6846 __tmp = xmlNode(_obj=ret)
6847 return __tmp
6848
6849 def xpathNextChild(self, cur):
6850 """Traversal function for the "child" direction The child axis
6851 contains the children of the context node in document order. """
6852 if cur is None: cur__o = None
6853 else: cur__o = cur._o
6854 ret = libxml2mod.xmlXPathNextChild(self._o, cur__o)
6855 if ret is None:raise xpathError('xmlXPathNextChild() failed')
6856 __tmp = xmlNode(_obj=ret)
6857 return __tmp
6858
6859 def xpathNextDescendant(self, cur):
6860 """Traversal function for the "descendant" direction the
6861 descendant axis contains the descendants of the context
6862 node in document order; a descendant is a child or a child
6863 of a child and so on. """
6864 if cur is None: cur__o = None
6865 else: cur__o = cur._o
6866 ret = libxml2mod.xmlXPathNextDescendant(self._o, cur__o)
6867 if ret is None:raise xpathError('xmlXPathNextDescendant() failed')
6868 __tmp = xmlNode(_obj=ret)
6869 return __tmp
6870
6871 def xpathNextDescendantOrSelf(self, cur):
6872 """Traversal function for the "descendant-or-self" direction
6873 the descendant-or-self axis contains the context node and
6874 the descendants of the context node in document order; thus
6875 the context node is the first node on the axis, and the
6876 first child of the context node is the second node on the
6877 axis """
6878 if cur is None: cur__o = None
6879 else: cur__o = cur._o
6880 ret = libxml2mod.xmlXPathNextDescendantOrSelf(self._o, cur__o)
6881 if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed')
6882 __tmp = xmlNode(_obj=ret)
6883 return __tmp
6884
6885 def xpathNextFollowing(self, cur):
6886 """Traversal function for the "following" direction The
6887 following axis contains all nodes in the same document as
6888 the context node that are after the context node in
6889 document order, excluding any descendants and excluding
6890 attribute nodes and namespace nodes; the nodes are ordered
6891 in document order """
6892 if cur is None: cur__o = None
6893 else: cur__o = cur._o
6894 ret = libxml2mod.xmlXPathNextFollowing(self._o, cur__o)
6895 if ret is None:raise xpathError('xmlXPathNextFollowing() failed')
6896 __tmp = xmlNode(_obj=ret)
6897 return __tmp
6898
6899 def xpathNextFollowingSibling(self, cur):
6900 """Traversal function for the "following-sibling" direction
6901 The following-sibling axis contains the following siblings
6902 of the context node in document order. """
6903 if cur is None: cur__o = None
6904 else: cur__o = cur._o
6905 ret = libxml2mod.xmlXPathNextFollowingSibling(self._o, cur__o)
6906 if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed')
6907 __tmp = xmlNode(_obj=ret)
6908 return __tmp
6909
6910 def xpathNextNamespace(self, cur):
6911 """Traversal function for the "namespace" direction the
6912 namespace axis contains the namespace nodes of the context
6913 node; the order of nodes on this axis is
6914 implementation-defined; the axis will be empty unless the
6915 context node is an element We keep the XML namespace node
6916 at the end of the list. """
6917 if cur is None: cur__o = None
6918 else: cur__o = cur._o
6919 ret = libxml2mod.xmlXPathNextNamespace(self._o, cur__o)
6920 if ret is None:raise xpathError('xmlXPathNextNamespace() failed')
6921 __tmp = xmlNode(_obj=ret)
6922 return __tmp
6923
6924 def xpathNextParent(self, cur):
6925 """Traversal function for the "parent" direction The parent
6926 axis contains the parent of the context node, if there is
6927 one. """
6928 if cur is None: cur__o = None
6929 else: cur__o = cur._o
6930 ret = libxml2mod.xmlXPathNextParent(self._o, cur__o)
6931 if ret is None:raise xpathError('xmlXPathNextParent() failed')
6932 __tmp = xmlNode(_obj=ret)
6933 return __tmp
6934
6935 def xpathNextPreceding(self, cur):
6936 """Traversal function for the "preceding" direction the
6937 preceding axis contains all nodes in the same document as
6938 the context node that are before the context node in
6939 document order, excluding any ancestors and excluding
6940 attribute nodes and namespace nodes; the nodes are ordered
6941 in reverse document order """
6942 if cur is None: cur__o = None
6943 else: cur__o = cur._o
6944 ret = libxml2mod.xmlXPathNextPreceding(self._o, cur__o)
6945 if ret is None:raise xpathError('xmlXPathNextPreceding() failed')
6946 __tmp = xmlNode(_obj=ret)
6947 return __tmp
6948
6949 def xpathNextPrecedingSibling(self, cur):
6950 """Traversal function for the "preceding-sibling" direction
6951 The preceding-sibling axis contains the preceding siblings
6952 of the context node in reverse document order; the first
6953 preceding sibling is first on the axis; the sibling
6954 preceding that node is the second on the axis and so on. """
6955 if cur is None: cur__o = None
6956 else: cur__o = cur._o
6957 ret = libxml2mod.xmlXPathNextPrecedingSibling(self._o, cur__o)
6958 if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed')
6959 __tmp = xmlNode(_obj=ret)
6960 return __tmp
6961
6962 def xpathNextSelf(self, cur):
6963 """Traversal function for the "self" direction The self axis
6964 contains just the context node itself """
6965 if cur is None: cur__o = None
6966 else: cur__o = cur._o
6967 ret = libxml2mod.xmlXPathNextSelf(self._o, cur__o)
6968 if ret is None:raise xpathError('xmlXPathNextSelf() failed')
6969 __tmp = xmlNode(_obj=ret)
6970 return __tmp
6971
6972 def xpathNormalizeFunction(self, nargs):
6973 """Implement the normalize-space() XPath function string
6974 normalize-space(string?) The normalize-space function
6975 returns the argument string with white space normalized by
6976 stripping leading and trailing whitespace and replacing
6977 sequences of whitespace characters by a single space.
6978 Whitespace characters are the same allowed by the S
6979 production in XML. If the argument is omitted, it defaults
6980 to the context node converted to a string, in other words
6981 the value of the context node. """
6982 libxml2mod.xmlXPathNormalizeFunction(self._o, nargs)
6983
6984 def xpathNotEqualValues(self):
6985 """Implement the equal operation on XPath objects content:
6986 @arg1 == @arg2 """
6987 ret = libxml2mod.xmlXPathNotEqualValues(self._o)
6988 return ret
6989
6990 def xpathNotFunction(self, nargs):
6991 """Implement the not() XPath function boolean not(boolean) The
6992 not function returns true if its argument is false, and
6993 false otherwise. """
6994 libxml2mod.xmlXPathNotFunction(self._o, nargs)
6995
6996 def xpathNumberFunction(self, nargs):
6997 """Implement the number() XPath function number number(object?) """
6998 libxml2mod.xmlXPathNumberFunction(self._o, nargs)
6999
7000 def xpathParseNCName(self):
7001 """parse an XML namespace non qualified name. [NS 3] NCName
7002 ::= (Letter | '_') (NCNameChar)* [NS 4] NCNameChar ::=
7003 Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender """
7004 ret = libxml2mod.xmlXPathParseNCName(self._o)
7005 return ret
7006
7007 def xpathParseName(self):
7008 """parse an XML name [4] NameChar ::= Letter | Digit | '.' |
7009 '-' | '_' | ':' | CombiningChar | Extender [5] Name ::=
7010 (Letter | '_' | ':') (NameChar)* """
7011 ret = libxml2mod.xmlXPathParseName(self._o)
7012 return ret
7013
7014 def xpathPopBoolean(self):
7015 """Pops a boolean from the stack, handling conversion if
7016 needed. Check error with #xmlXPathCheckError. """
7017 ret = libxml2mod.xmlXPathPopBoolean(self._o)
7018 return ret
7019
7020 def xpathPopNumber(self):
7021 """Pops a number from the stack, handling conversion if
7022 needed. Check error with #xmlXPathCheckError. """
7023 ret = libxml2mod.xmlXPathPopNumber(self._o)
7024 return ret
7025
7026 def xpathPopString(self):
7027 """Pops a string from the stack, handling conversion if
7028 needed. Check error with #xmlXPathCheckError. """
7029 ret = libxml2mod.xmlXPathPopString(self._o)
7030 return ret
7031
7032 def xpathPositionFunction(self, nargs):
7033 """Implement the position() XPath function number position()
7034 The position function returns the position of the context
7035 node in the context node list. The first position is 1, and
7036 so the last position will be equal to last(). """
7037 libxml2mod.xmlXPathPositionFunction(self._o, nargs)
7038
7039 def xpathRoot(self):
7040 """Initialize the context to the root of the document """
7041 libxml2mod.xmlXPathRoot(self._o)
7042
7043 def xpathRoundFunction(self, nargs):
7044 """Implement the round() XPath function number round(number)
7045 The round function returns the number that is closest to
7046 the argument and that is an integer. If there are two such
7047 numbers, then the one that is even is returned. """
7048 libxml2mod.xmlXPathRoundFunction(self._o, nargs)
7049
7050 def xpathStartsWithFunction(self, nargs):
7051 """Implement the starts-with() XPath function boolean
7052 starts-with(string, string) The starts-with function
7053 returns true if the first argument string starts with the
7054 second argument string, and otherwise returns false. """
7055 libxml2mod.xmlXPathStartsWithFunction(self._o, nargs)
7056
7057 def xpathStringFunction(self, nargs):
7058 """Implement the string() XPath function string
7059 string(object?) The string function converts an object to a
7060 string as follows: - A node-set is converted to a string by
7061 returning the value of the node in the node-set that is
7062 first in document order. If the node-set is empty, an empty
7063 string is returned. - A number is converted to a string as
7064 follows + NaN is converted to the string NaN + positive
7065 zero is converted to the string 0 + negative zero is
7066 converted to the string 0 + positive infinity is converted
7067 to the string Infinity + negative infinity is converted to
7068 the string -Infinity + if the number is an integer, the
7069 number is represented in decimal form as a Number with no
7070 decimal point and no leading zeros, preceded by a minus
7071 sign (-) if the number is negative + otherwise, the number
7072 is represented in decimal form as a Number including a
7073 decimal point with at least one digit before the decimal
7074 point and at least one digit after the decimal point,
7075 preceded by a minus sign (-) if the number is negative;
7076 there must be no leading zeros before the decimal point
7077 apart possibly from the one required digit immediately
7078 before the decimal point; beyond the one required digit
7079 after the decimal point there must be as many, but only as
7080 many, more digits as are needed to uniquely distinguish the
7081 number from all other IEEE 754 numeric values. - The
7082 boolean false value is converted to the string false. The
7083 boolean true value is converted to the string true. If the
7084 argument is omitted, it defaults to a node-set with the
7085 context node as its only member. """
7086 libxml2mod.xmlXPathStringFunction(self._o, nargs)
7087
7088 def xpathStringLengthFunction(self, nargs):
7089 """Implement the string-length() XPath function number
7090 string-length(string?) The string-length returns the number
7091 of characters in the string (see [3.6 Strings]). If the
7092 argument is omitted, it defaults to the context node
7093 converted to a string, in other words the value of the
7094 context node. """
7095 libxml2mod.xmlXPathStringLengthFunction(self._o, nargs)
7096
7097 def xpathSubValues(self):
7098 """Implement the subtraction operation on XPath objects: The
7099 numeric operators convert their operands to numbers as if
7100 by calling the number function. """
7101 libxml2mod.xmlXPathSubValues(self._o)
7102
7103 def xpathSubstringAfterFunction(self, nargs):
7104 """Implement the substring-after() XPath function string
7105 substring-after(string, string) The substring-after
7106 function returns the substring of the first argument string
7107 that follows the first occurrence of the second argument
7108 string in the first argument string, or the empty stringi
7109 if the first argument string does not contain the second
7110 argument string. For example,
7111 substring-after("1999/04/01","/") returns 04/01, and
7112 substring-after("1999/04/01","19") returns 99/04/01. """
7113 libxml2mod.xmlXPathSubstringAfterFunction(self._o, nargs)
7114
7115 def xpathSubstringBeforeFunction(self, nargs):
7116 """Implement the substring-before() XPath function string
7117 substring-before(string, string) The substring-before
7118 function returns the substring of the first argument string
7119 that precedes the first occurrence of the second argument
7120 string in the first argument string, or the empty string if
7121 the first argument string does not contain the second
7122 argument string. For example,
7123 substring-before("1999/04/01","/") returns 1999. """
7124 libxml2mod.xmlXPathSubstringBeforeFunction(self._o, nargs)
7125
7126 def xpathSubstringFunction(self, nargs):
7127 """Implement the substring() XPath function string
7128 substring(string, number, number?) The substring function
7129 returns the substring of the first argument starting at the
7130 position specified in the second argument with length
7131 specified in the third argument. For example,
7132 substring("12345",2,3) returns "234". If the third argument
7133 is not specified, it returns the substring starting at the
7134 position specified in the second argument and continuing to
7135 the end of the string. For example, substring("12345",2)
7136 returns "2345". More precisely, each character in the
7137 string (see [3.6 Strings]) is considered to have a numeric
7138 position: the position of the first character is 1, the
7139 position of the second character is 2 and so on. The
7140 returned substring contains those characters for which the
7141 position of the character is greater than or equal to the
7142 second argument and, if the third argument is specified,
7143 less than the sum of the second and third arguments; the
7144 comparisons and addition used for the above follow the
7145 standard IEEE 754 rules. Thus: - substring("12345", 1.5,
7146 2.6) returns "234" - substring("12345", 0, 3) returns "12"
7147 - substring("12345", 0 div 0, 3) returns "" -
7148 substring("12345", 1, 0 div 0) returns "" -
7149 substring("12345", -42, 1 div 0) returns "12345" -
7150 substring("12345", -1 div 0, 1 div 0) returns "" """
7151 libxml2mod.xmlXPathSubstringFunction(self._o, nargs)
7152
7153 def xpathSumFunction(self, nargs):
7154 """Implement the sum() XPath function number sum(node-set) The
7155 sum function returns the sum of the values of the nodes in
7156 the argument node-set. """
7157 libxml2mod.xmlXPathSumFunction(self._o, nargs)
7158
7159 def xpathTranslateFunction(self, nargs):
7160 """Implement the translate() XPath function string
7161 translate(string, string, string) The translate function
7162 returns the first argument string with occurrences of
7163 characters in the second argument string replaced by the
7164 character at the corresponding position in the third
7165 argument string. For example, translate("bar","abc","ABC")
7166 returns the string BAr. If there is a character in the
7167 second argument string with no character at a corresponding
7168 position in the third argument string (because the second
7169 argument string is longer than the third argument string),
7170 then occurrences of that character in the first argument
7171 string are removed. For example,
7172 translate("--aaa--","abc-","ABC") """
7173 libxml2mod.xmlXPathTranslateFunction(self._o, nargs)
7174
7175 def xpathTrueFunction(self, nargs):
7176 """Implement the true() XPath function boolean true() """
7177 libxml2mod.xmlXPathTrueFunction(self._o, nargs)
7178
7179 def xpathValueFlipSign(self):
7180 """Implement the unary - operation on an XPath object The
7181 numeric operators convert their operands to numbers as if
7182 by calling the number function. """
7183 libxml2mod.xmlXPathValueFlipSign(self._o)
7184
7185 def xpatherror(self, file, line, no):
7186 """Formats an error message. """
7187 libxml2mod.xmlXPatherror(self._o, file, line, no)
7188
7189 #
7190 # xpathParserContext functions from module xpointer
7191 #
7192
7193 def xpointerEvalRangePredicate(self):
7194 """[8] Predicate ::= '[' PredicateExpr ']' [9]
7195 PredicateExpr ::= Expr Evaluate a predicate as in
7196 xmlXPathEvalPredicate() but for a Location Set instead of a
7197 node set """
7198 libxml2mod.xmlXPtrEvalRangePredicate(self._o)
7199
7200 def xpointerRangeToFunction(self, nargs):
7201 """Implement the range-to() XPointer function """
7202 libxml2mod.xmlXPtrRangeToFunction(self._o, nargs)
7203
7204# xlinkShow
7205XLINK_SHOW_NONE = 0
7206XLINK_SHOW_NEW = 1
7207XLINK_SHOW_EMBED = 2
7208XLINK_SHOW_REPLACE = 3
7209
7210# xmlRelaxNGParserFlag
7211XML_RELAXNGP_NONE = 0
7212XML_RELAXNGP_FREE_DOC = 1
7213XML_RELAXNGP_CRNG = 2
7214
7215# xmlBufferAllocationScheme
7216XML_BUFFER_ALLOC_DOUBLEIT = 1
7217XML_BUFFER_ALLOC_EXACT = 2
7218XML_BUFFER_ALLOC_IMMUTABLE = 3
7219XML_BUFFER_ALLOC_IO = 4
7220XML_BUFFER_ALLOC_HYBRID = 5
7221XML_BUFFER_ALLOC_BOUNDED = 6
7222
7223# xmlParserSeverities
7224XML_PARSER_SEVERITY_VALIDITY_WARNING = 1
7225XML_PARSER_SEVERITY_VALIDITY_ERROR = 2
7226XML_PARSER_SEVERITY_WARNING = 3
7227XML_PARSER_SEVERITY_ERROR = 4
7228
7229# xmlAttributeDefault
7230XML_ATTRIBUTE_NONE = 1
7231XML_ATTRIBUTE_REQUIRED = 2
7232XML_ATTRIBUTE_IMPLIED = 3
7233XML_ATTRIBUTE_FIXED = 4
7234
7235# xmlSchemaValType
7236XML_SCHEMAS_UNKNOWN = 0
7237XML_SCHEMAS_STRING = 1
7238XML_SCHEMAS_NORMSTRING = 2
7239XML_SCHEMAS_DECIMAL = 3
7240XML_SCHEMAS_TIME = 4
7241XML_SCHEMAS_GDAY = 5
7242XML_SCHEMAS_GMONTH = 6
7243XML_SCHEMAS_GMONTHDAY = 7
7244XML_SCHEMAS_GYEAR = 8
7245XML_SCHEMAS_GYEARMONTH = 9
7246XML_SCHEMAS_DATE = 10
7247XML_SCHEMAS_DATETIME = 11
7248XML_SCHEMAS_DURATION = 12
7249XML_SCHEMAS_FLOAT = 13
7250XML_SCHEMAS_DOUBLE = 14
7251XML_SCHEMAS_BOOLEAN = 15
7252XML_SCHEMAS_TOKEN = 16
7253XML_SCHEMAS_LANGUAGE = 17
7254XML_SCHEMAS_NMTOKEN = 18
7255XML_SCHEMAS_NMTOKENS = 19
7256XML_SCHEMAS_NAME = 20
7257XML_SCHEMAS_QNAME = 21
7258XML_SCHEMAS_NCNAME = 22
7259XML_SCHEMAS_ID = 23
7260XML_SCHEMAS_IDREF = 24
7261XML_SCHEMAS_IDREFS = 25
7262XML_SCHEMAS_ENTITY = 26
7263XML_SCHEMAS_ENTITIES = 27
7264XML_SCHEMAS_NOTATION = 28
7265XML_SCHEMAS_ANYURI = 29
7266XML_SCHEMAS_INTEGER = 30
7267XML_SCHEMAS_NPINTEGER = 31
7268XML_SCHEMAS_NINTEGER = 32
7269XML_SCHEMAS_NNINTEGER = 33
7270XML_SCHEMAS_PINTEGER = 34
7271XML_SCHEMAS_INT = 35
7272XML_SCHEMAS_UINT = 36
7273XML_SCHEMAS_LONG = 37
7274XML_SCHEMAS_ULONG = 38
7275XML_SCHEMAS_SHORT = 39
7276XML_SCHEMAS_USHORT = 40
7277XML_SCHEMAS_BYTE = 41
7278XML_SCHEMAS_UBYTE = 42
7279XML_SCHEMAS_HEXBINARY = 43
7280XML_SCHEMAS_BASE64BINARY = 44
7281XML_SCHEMAS_ANYTYPE = 45
7282XML_SCHEMAS_ANYSIMPLETYPE = 46
7283
7284# xmlParserInputState
7285XML_PARSER_EOF = -1
7286XML_PARSER_START = 0
7287XML_PARSER_MISC = 1
7288XML_PARSER_PI = 2
7289XML_PARSER_DTD = 3
7290XML_PARSER_PROLOG = 4
7291XML_PARSER_COMMENT = 5
7292XML_PARSER_START_TAG = 6
7293XML_PARSER_CONTENT = 7
7294XML_PARSER_CDATA_SECTION = 8
7295XML_PARSER_END_TAG = 9
7296XML_PARSER_ENTITY_DECL = 10
7297XML_PARSER_ENTITY_VALUE = 11
7298XML_PARSER_ATTRIBUTE_VALUE = 12
7299XML_PARSER_SYSTEM_LITERAL = 13
7300XML_PARSER_EPILOG = 14
7301XML_PARSER_IGNORE = 15
7302XML_PARSER_PUBLIC_LITERAL = 16
7303
7304# xmlEntityType
7305XML_INTERNAL_GENERAL_ENTITY = 1
7306XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2
7307XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3
7308XML_INTERNAL_PARAMETER_ENTITY = 4
7309XML_EXTERNAL_PARAMETER_ENTITY = 5
7310XML_INTERNAL_PREDEFINED_ENTITY = 6
7311
7312# xmlSaveOption
7313XML_SAVE_FORMAT = 1
7314XML_SAVE_NO_DECL = 2
7315XML_SAVE_NO_EMPTY = 4
7316XML_SAVE_NO_XHTML = 8
7317XML_SAVE_XHTML = 16
7318XML_SAVE_AS_XML = 32
7319XML_SAVE_AS_HTML = 64
7320XML_SAVE_WSNONSIG = 128
7321
7322# xmlPatternFlags
7323XML_PATTERN_DEFAULT = 0
7324XML_PATTERN_XPATH = 1
7325XML_PATTERN_XSSEL = 2
7326XML_PATTERN_XSFIELD = 4
7327
7328# xmlParserErrors
7329XML_ERR_OK = 0
7330XML_ERR_INTERNAL_ERROR = 1
7331XML_ERR_NO_MEMORY = 2
7332XML_ERR_DOCUMENT_START = 3
7333XML_ERR_DOCUMENT_EMPTY = 4
7334XML_ERR_DOCUMENT_END = 5
7335XML_ERR_INVALID_HEX_CHARREF = 6
7336XML_ERR_INVALID_DEC_CHARREF = 7
7337XML_ERR_INVALID_CHARREF = 8
7338XML_ERR_INVALID_CHAR = 9
7339XML_ERR_CHARREF_AT_EOF = 10
7340XML_ERR_CHARREF_IN_PROLOG = 11
7341XML_ERR_CHARREF_IN_EPILOG = 12
7342XML_ERR_CHARREF_IN_DTD = 13
7343XML_ERR_ENTITYREF_AT_EOF = 14
7344XML_ERR_ENTITYREF_IN_PROLOG = 15
7345XML_ERR_ENTITYREF_IN_EPILOG = 16
7346XML_ERR_ENTITYREF_IN_DTD = 17
7347XML_ERR_PEREF_AT_EOF = 18
7348XML_ERR_PEREF_IN_PROLOG = 19
7349XML_ERR_PEREF_IN_EPILOG = 20
7350XML_ERR_PEREF_IN_INT_SUBSET = 21
7351XML_ERR_ENTITYREF_NO_NAME = 22
7352XML_ERR_ENTITYREF_SEMICOL_MISSING = 23
7353XML_ERR_PEREF_NO_NAME = 24
7354XML_ERR_PEREF_SEMICOL_MISSING = 25
7355XML_ERR_UNDECLARED_ENTITY = 26
7356XML_WAR_UNDECLARED_ENTITY = 27
7357XML_ERR_UNPARSED_ENTITY = 28
7358XML_ERR_ENTITY_IS_EXTERNAL = 29
7359XML_ERR_ENTITY_IS_PARAMETER = 30
7360XML_ERR_UNKNOWN_ENCODING = 31
7361XML_ERR_UNSUPPORTED_ENCODING = 32
7362XML_ERR_STRING_NOT_STARTED = 33
7363XML_ERR_STRING_NOT_CLOSED = 34
7364XML_ERR_NS_DECL_ERROR = 35
7365XML_ERR_ENTITY_NOT_STARTED = 36
7366XML_ERR_ENTITY_NOT_FINISHED = 37
7367XML_ERR_LT_IN_ATTRIBUTE = 38
7368XML_ERR_ATTRIBUTE_NOT_STARTED = 39
7369XML_ERR_ATTRIBUTE_NOT_FINISHED = 40
7370XML_ERR_ATTRIBUTE_WITHOUT_VALUE = 41
7371XML_ERR_ATTRIBUTE_REDEFINED = 42
7372XML_ERR_LITERAL_NOT_STARTED = 43
7373XML_ERR_LITERAL_NOT_FINISHED = 44
7374XML_ERR_COMMENT_NOT_FINISHED = 45
7375XML_ERR_PI_NOT_STARTED = 46
7376XML_ERR_PI_NOT_FINISHED = 47
7377XML_ERR_NOTATION_NOT_STARTED = 48
7378XML_ERR_NOTATION_NOT_FINISHED = 49
7379XML_ERR_ATTLIST_NOT_STARTED = 50
7380XML_ERR_ATTLIST_NOT_FINISHED = 51
7381XML_ERR_MIXED_NOT_STARTED = 52
7382XML_ERR_MIXED_NOT_FINISHED = 53
7383XML_ERR_ELEMCONTENT_NOT_STARTED = 54
7384XML_ERR_ELEMCONTENT_NOT_FINISHED = 55
7385XML_ERR_XMLDECL_NOT_STARTED = 56
7386XML_ERR_XMLDECL_NOT_FINISHED = 57
7387XML_ERR_CONDSEC_NOT_STARTED = 58
7388XML_ERR_CONDSEC_NOT_FINISHED = 59
7389XML_ERR_EXT_SUBSET_NOT_FINISHED = 60
7390XML_ERR_DOCTYPE_NOT_FINISHED = 61
7391XML_ERR_MISPLACED_CDATA_END = 62
7392XML_ERR_CDATA_NOT_FINISHED = 63
7393XML_ERR_RESERVED_XML_NAME = 64
7394XML_ERR_SPACE_REQUIRED = 65
7395XML_ERR_SEPARATOR_REQUIRED = 66
7396XML_ERR_NMTOKEN_REQUIRED = 67
7397XML_ERR_NAME_REQUIRED = 68
7398XML_ERR_PCDATA_REQUIRED = 69
7399XML_ERR_URI_REQUIRED = 70
7400XML_ERR_PUBID_REQUIRED = 71
7401XML_ERR_LT_REQUIRED = 72
7402XML_ERR_GT_REQUIRED = 73
7403XML_ERR_LTSLASH_REQUIRED = 74
7404XML_ERR_EQUAL_REQUIRED = 75
7405XML_ERR_TAG_NAME_MISMATCH = 76
7406XML_ERR_TAG_NOT_FINISHED = 77
7407XML_ERR_STANDALONE_VALUE = 78
7408XML_ERR_ENCODING_NAME = 79
7409XML_ERR_HYPHEN_IN_COMMENT = 80
7410XML_ERR_INVALID_ENCODING = 81
7411XML_ERR_EXT_ENTITY_STANDALONE = 82
7412XML_ERR_CONDSEC_INVALID = 83
7413XML_ERR_VALUE_REQUIRED = 84
7414XML_ERR_NOT_WELL_BALANCED = 85
7415XML_ERR_EXTRA_CONTENT = 86
7416XML_ERR_ENTITY_CHAR_ERROR = 87
7417XML_ERR_ENTITY_PE_INTERNAL = 88
7418XML_ERR_ENTITY_LOOP = 89
7419XML_ERR_ENTITY_BOUNDARY = 90
7420XML_ERR_INVALID_URI = 91
7421XML_ERR_URI_FRAGMENT = 92
7422XML_WAR_CATALOG_PI = 93
7423XML_ERR_NO_DTD = 94
7424XML_ERR_CONDSEC_INVALID_KEYWORD = 95
7425XML_ERR_VERSION_MISSING = 96
7426XML_WAR_UNKNOWN_VERSION = 97
7427XML_WAR_LANG_VALUE = 98
7428XML_WAR_NS_URI = 99
7429XML_WAR_NS_URI_RELATIVE = 100
7430XML_ERR_MISSING_ENCODING = 101
7431XML_WAR_SPACE_VALUE = 102
7432XML_ERR_NOT_STANDALONE = 103
7433XML_ERR_ENTITY_PROCESSING = 104
7434XML_ERR_NOTATION_PROCESSING = 105
7435XML_WAR_NS_COLUMN = 106
7436XML_WAR_ENTITY_REDEFINED = 107
7437XML_ERR_UNKNOWN_VERSION = 108
7438XML_ERR_VERSION_MISMATCH = 109
7439XML_ERR_NAME_TOO_LONG = 110
7440XML_ERR_USER_STOP = 111
7441XML_NS_ERR_XML_NAMESPACE = 200
7442XML_NS_ERR_UNDEFINED_NAMESPACE = 201
7443XML_NS_ERR_QNAME = 202
7444XML_NS_ERR_ATTRIBUTE_REDEFINED = 203
7445XML_NS_ERR_EMPTY = 204
7446XML_NS_ERR_COLON = 205
7447XML_DTD_ATTRIBUTE_DEFAULT = 500
7448XML_DTD_ATTRIBUTE_REDEFINED = 501
7449XML_DTD_ATTRIBUTE_VALUE = 502
7450XML_DTD_CONTENT_ERROR = 503
7451XML_DTD_CONTENT_MODEL = 504
7452XML_DTD_CONTENT_NOT_DETERMINIST = 505
7453XML_DTD_DIFFERENT_PREFIX = 506
7454XML_DTD_ELEM_DEFAULT_NAMESPACE = 507
7455XML_DTD_ELEM_NAMESPACE = 508
7456XML_DTD_ELEM_REDEFINED = 509
7457XML_DTD_EMPTY_NOTATION = 510
7458XML_DTD_ENTITY_TYPE = 511
7459XML_DTD_ID_FIXED = 512
7460XML_DTD_ID_REDEFINED = 513
7461XML_DTD_ID_SUBSET = 514
7462XML_DTD_INVALID_CHILD = 515
7463XML_DTD_INVALID_DEFAULT = 516
7464XML_DTD_LOAD_ERROR = 517
7465XML_DTD_MISSING_ATTRIBUTE = 518
7466XML_DTD_MIXED_CORRUPT = 519
7467XML_DTD_MULTIPLE_ID = 520
7468XML_DTD_NO_DOC = 521
7469XML_DTD_NO_DTD = 522
7470XML_DTD_NO_ELEM_NAME = 523
7471XML_DTD_NO_PREFIX = 524
7472XML_DTD_NO_ROOT = 525
7473XML_DTD_NOTATION_REDEFINED = 526
7474XML_DTD_NOTATION_VALUE = 527
7475XML_DTD_NOT_EMPTY = 528
7476XML_DTD_NOT_PCDATA = 529
7477XML_DTD_NOT_STANDALONE = 530
7478XML_DTD_ROOT_NAME = 531
7479XML_DTD_STANDALONE_WHITE_SPACE = 532
7480XML_DTD_UNKNOWN_ATTRIBUTE = 533
7481XML_DTD_UNKNOWN_ELEM = 534
7482XML_DTD_UNKNOWN_ENTITY = 535
7483XML_DTD_UNKNOWN_ID = 536
7484XML_DTD_UNKNOWN_NOTATION = 537
7485XML_DTD_STANDALONE_DEFAULTED = 538
7486XML_DTD_XMLID_VALUE = 539
7487XML_DTD_XMLID_TYPE = 540
7488XML_DTD_DUP_TOKEN = 541
7489XML_HTML_STRUCURE_ERROR = 800
7490XML_HTML_UNKNOWN_TAG = 801
7491XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000
7492XML_RNGP_ATTR_CONFLICT = 1001
7493XML_RNGP_ATTRIBUTE_CHILDREN = 1002
7494XML_RNGP_ATTRIBUTE_CONTENT = 1003
7495XML_RNGP_ATTRIBUTE_EMPTY = 1004
7496XML_RNGP_ATTRIBUTE_NOOP = 1005
7497XML_RNGP_CHOICE_CONTENT = 1006
7498XML_RNGP_CHOICE_EMPTY = 1007
7499XML_RNGP_CREATE_FAILURE = 1008
7500XML_RNGP_DATA_CONTENT = 1009
7501XML_RNGP_DEF_CHOICE_AND_INTERLEAVE = 1010
7502XML_RNGP_DEFINE_CREATE_FAILED = 1011
7503XML_RNGP_DEFINE_EMPTY = 1012
7504XML_RNGP_DEFINE_MISSING = 1013
7505XML_RNGP_DEFINE_NAME_MISSING = 1014
7506XML_RNGP_ELEM_CONTENT_EMPTY = 1015
7507XML_RNGP_ELEM_CONTENT_ERROR = 1016
7508XML_RNGP_ELEMENT_EMPTY = 1017
7509XML_RNGP_ELEMENT_CONTENT = 1018
7510XML_RNGP_ELEMENT_NAME = 1019
7511XML_RNGP_ELEMENT_NO_CONTENT = 1020
7512XML_RNGP_ELEM_TEXT_CONFLICT = 1021
7513XML_RNGP_EMPTY = 1022
7514XML_RNGP_EMPTY_CONSTRUCT = 1023
7515XML_RNGP_EMPTY_CONTENT = 1024
7516XML_RNGP_EMPTY_NOT_EMPTY = 1025
7517XML_RNGP_ERROR_TYPE_LIB = 1026
7518XML_RNGP_EXCEPT_EMPTY = 1027
7519XML_RNGP_EXCEPT_MISSING = 1028
7520XML_RNGP_EXCEPT_MULTIPLE = 1029
7521XML_RNGP_EXCEPT_NO_CONTENT = 1030
7522XML_RNGP_EXTERNALREF_EMTPY = 1031
7523XML_RNGP_EXTERNAL_REF_FAILURE = 1032
7524XML_RNGP_EXTERNALREF_RECURSE = 1033
7525XML_RNGP_FORBIDDEN_ATTRIBUTE = 1034
7526XML_RNGP_FOREIGN_ELEMENT = 1035
7527XML_RNGP_GRAMMAR_CONTENT = 1036
7528XML_RNGP_GRAMMAR_EMPTY = 1037
7529XML_RNGP_GRAMMAR_MISSING = 1038
7530XML_RNGP_GRAMMAR_NO_START = 1039
7531XML_RNGP_GROUP_ATTR_CONFLICT = 1040
7532XML_RNGP_HREF_ERROR = 1041
7533XML_RNGP_INCLUDE_EMPTY = 1042
7534XML_RNGP_INCLUDE_FAILURE = 1043
7535XML_RNGP_INCLUDE_RECURSE = 1044
7536XML_RNGP_INTERLEAVE_ADD = 1045
7537XML_RNGP_INTERLEAVE_CREATE_FAILED = 1046
7538XML_RNGP_INTERLEAVE_EMPTY = 1047
7539XML_RNGP_INTERLEAVE_NO_CONTENT = 1048
7540XML_RNGP_INVALID_DEFINE_NAME = 1049
7541XML_RNGP_INVALID_URI = 1050
7542XML_RNGP_INVALID_VALUE = 1051
7543XML_RNGP_MISSING_HREF = 1052
7544XML_RNGP_NAME_MISSING = 1053
7545XML_RNGP_NEED_COMBINE = 1054
7546XML_RNGP_NOTALLOWED_NOT_EMPTY = 1055
7547XML_RNGP_NSNAME_ATTR_ANCESTOR = 1056
7548XML_RNGP_NSNAME_NO_NS = 1057
7549XML_RNGP_PARAM_FORBIDDEN = 1058
7550XML_RNGP_PARAM_NAME_MISSING = 1059
7551XML_RNGP_PARENTREF_CREATE_FAILED = 1060
7552XML_RNGP_PARENTREF_NAME_INVALID = 1061
7553XML_RNGP_PARENTREF_NO_NAME = 1062
7554XML_RNGP_PARENTREF_NO_PARENT = 1063
7555XML_RNGP_PARENTREF_NOT_EMPTY = 1064
7556XML_RNGP_PARSE_ERROR = 1065
7557XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME = 1066
7558XML_RNGP_PAT_ATTR_ATTR = 1067
7559XML_RNGP_PAT_ATTR_ELEM = 1068
7560XML_RNGP_PAT_DATA_EXCEPT_ATTR = 1069
7561XML_RNGP_PAT_DATA_EXCEPT_ELEM = 1070
7562XML_RNGP_PAT_DATA_EXCEPT_EMPTY = 1071
7563XML_RNGP_PAT_DATA_EXCEPT_GROUP = 1072
7564XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE = 1073
7565XML_RNGP_PAT_DATA_EXCEPT_LIST = 1074
7566XML_RNGP_PAT_DATA_EXCEPT_ONEMORE = 1075
7567XML_RNGP_PAT_DATA_EXCEPT_REF = 1076
7568XML_RNGP_PAT_DATA_EXCEPT_TEXT = 1077
7569XML_RNGP_PAT_LIST_ATTR = 1078
7570XML_RNGP_PAT_LIST_ELEM = 1079
7571XML_RNGP_PAT_LIST_INTERLEAVE = 1080
7572XML_RNGP_PAT_LIST_LIST = 1081
7573XML_RNGP_PAT_LIST_REF = 1082
7574XML_RNGP_PAT_LIST_TEXT = 1083
7575XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME = 1084
7576XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME = 1085
7577XML_RNGP_PAT_ONEMORE_GROUP_ATTR = 1086
7578XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR = 1087
7579XML_RNGP_PAT_START_ATTR = 1088
7580XML_RNGP_PAT_START_DATA = 1089
7581XML_RNGP_PAT_START_EMPTY = 1090
7582XML_RNGP_PAT_START_GROUP = 1091
7583XML_RNGP_PAT_START_INTERLEAVE = 1092
7584XML_RNGP_PAT_START_LIST = 1093
7585XML_RNGP_PAT_START_ONEMORE = 1094
7586XML_RNGP_PAT_START_TEXT = 1095
7587XML_RNGP_PAT_START_VALUE = 1096
7588XML_RNGP_PREFIX_UNDEFINED = 1097
7589XML_RNGP_REF_CREATE_FAILED = 1098
7590XML_RNGP_REF_CYCLE = 1099
7591XML_RNGP_REF_NAME_INVALID = 1100
7592XML_RNGP_REF_NO_DEF = 1101
7593XML_RNGP_REF_NO_NAME = 1102
7594XML_RNGP_REF_NOT_EMPTY = 1103
7595XML_RNGP_START_CHOICE_AND_INTERLEAVE = 1104
7596XML_RNGP_START_CONTENT = 1105
7597XML_RNGP_START_EMPTY = 1106
7598XML_RNGP_START_MISSING = 1107
7599XML_RNGP_TEXT_EXPECTED = 1108
7600XML_RNGP_TEXT_HAS_CHILD = 1109
7601XML_RNGP_TYPE_MISSING = 1110
7602XML_RNGP_TYPE_NOT_FOUND = 1111
7603XML_RNGP_TYPE_VALUE = 1112
7604XML_RNGP_UNKNOWN_ATTRIBUTE = 1113
7605XML_RNGP_UNKNOWN_COMBINE = 1114
7606XML_RNGP_UNKNOWN_CONSTRUCT = 1115
7607XML_RNGP_UNKNOWN_TYPE_LIB = 1116
7608XML_RNGP_URI_FRAGMENT = 1117
7609XML_RNGP_URI_NOT_ABSOLUTE = 1118
7610XML_RNGP_VALUE_EMPTY = 1119
7611XML_RNGP_VALUE_NO_CONTENT = 1120
7612XML_RNGP_XMLNS_NAME = 1121
7613XML_RNGP_XML_NS = 1122
7614XML_XPATH_EXPRESSION_OK = 1200
7615XML_XPATH_NUMBER_ERROR = 1201
7616XML_XPATH_UNFINISHED_LITERAL_ERROR = 1202
7617XML_XPATH_START_LITERAL_ERROR = 1203
7618XML_XPATH_VARIABLE_REF_ERROR = 1204
7619XML_XPATH_UNDEF_VARIABLE_ERROR = 1205
7620XML_XPATH_INVALID_PREDICATE_ERROR = 1206
7621XML_XPATH_EXPR_ERROR = 1207
7622XML_XPATH_UNCLOSED_ERROR = 1208
7623XML_XPATH_UNKNOWN_FUNC_ERROR = 1209
7624XML_XPATH_INVALID_OPERAND = 1210
7625XML_XPATH_INVALID_TYPE = 1211
7626XML_XPATH_INVALID_ARITY = 1212
7627XML_XPATH_INVALID_CTXT_SIZE = 1213
7628XML_XPATH_INVALID_CTXT_POSITION = 1214
7629XML_XPATH_MEMORY_ERROR = 1215
7630XML_XPTR_SYNTAX_ERROR = 1216
7631XML_XPTR_RESOURCE_ERROR = 1217
7632XML_XPTR_SUB_RESOURCE_ERROR = 1218
7633XML_XPATH_UNDEF_PREFIX_ERROR = 1219
7634XML_XPATH_ENCODING_ERROR = 1220
7635XML_XPATH_INVALID_CHAR_ERROR = 1221
7636XML_TREE_INVALID_HEX = 1300
7637XML_TREE_INVALID_DEC = 1301
7638XML_TREE_UNTERMINATED_ENTITY = 1302
7639XML_TREE_NOT_UTF8 = 1303
7640XML_SAVE_NOT_UTF8 = 1400
7641XML_SAVE_CHAR_INVALID = 1401
7642XML_SAVE_NO_DOCTYPE = 1402
7643XML_SAVE_UNKNOWN_ENCODING = 1403
7644XML_REGEXP_COMPILE_ERROR = 1450
7645XML_IO_UNKNOWN = 1500
7646XML_IO_EACCES = 1501
7647XML_IO_EAGAIN = 1502
7648XML_IO_EBADF = 1503
7649XML_IO_EBADMSG = 1504
7650XML_IO_EBUSY = 1505
7651XML_IO_ECANCELED = 1506
7652XML_IO_ECHILD = 1507
7653XML_IO_EDEADLK = 1508
7654XML_IO_EDOM = 1509
7655XML_IO_EEXIST = 1510
7656XML_IO_EFAULT = 1511
7657XML_IO_EFBIG = 1512
7658XML_IO_EINPROGRESS = 1513
7659XML_IO_EINTR = 1514
7660XML_IO_EINVAL = 1515
7661XML_IO_EIO = 1516
7662XML_IO_EISDIR = 1517
7663XML_IO_EMFILE = 1518
7664XML_IO_EMLINK = 1519
7665XML_IO_EMSGSIZE = 1520
7666XML_IO_ENAMETOOLONG = 1521
7667XML_IO_ENFILE = 1522
7668XML_IO_ENODEV = 1523
7669XML_IO_ENOENT = 1524
7670XML_IO_ENOEXEC = 1525
7671XML_IO_ENOLCK = 1526
7672XML_IO_ENOMEM = 1527
7673XML_IO_ENOSPC = 1528
7674XML_IO_ENOSYS = 1529
7675XML_IO_ENOTDIR = 1530
7676XML_IO_ENOTEMPTY = 1531
7677XML_IO_ENOTSUP = 1532
7678XML_IO_ENOTTY = 1533
7679XML_IO_ENXIO = 1534
7680XML_IO_EPERM = 1535
7681XML_IO_EPIPE = 1536
7682XML_IO_ERANGE = 1537
7683XML_IO_EROFS = 1538
7684XML_IO_ESPIPE = 1539
7685XML_IO_ESRCH = 1540
7686XML_IO_ETIMEDOUT = 1541
7687XML_IO_EXDEV = 1542
7688XML_IO_NETWORK_ATTEMPT = 1543
7689XML_IO_ENCODER = 1544
7690XML_IO_FLUSH = 1545
7691XML_IO_WRITE = 1546
7692XML_IO_NO_INPUT = 1547
7693XML_IO_BUFFER_FULL = 1548
7694XML_IO_LOAD_ERROR = 1549
7695XML_IO_ENOTSOCK = 1550
7696XML_IO_EISCONN = 1551
7697XML_IO_ECONNREFUSED = 1552
7698XML_IO_ENETUNREACH = 1553
7699XML_IO_EADDRINUSE = 1554
7700XML_IO_EALREADY = 1555
7701XML_IO_EAFNOSUPPORT = 1556
7702XML_XINCLUDE_RECURSION = 1600
7703XML_XINCLUDE_PARSE_VALUE = 1601
7704XML_XINCLUDE_ENTITY_DEF_MISMATCH = 1602
7705XML_XINCLUDE_NO_HREF = 1603
7706XML_XINCLUDE_NO_FALLBACK = 1604
7707XML_XINCLUDE_HREF_URI = 1605
7708XML_XINCLUDE_TEXT_FRAGMENT = 1606
7709XML_XINCLUDE_TEXT_DOCUMENT = 1607
7710XML_XINCLUDE_INVALID_CHAR = 1608
7711XML_XINCLUDE_BUILD_FAILED = 1609
7712XML_XINCLUDE_UNKNOWN_ENCODING = 1610
7713XML_XINCLUDE_MULTIPLE_ROOT = 1611
7714XML_XINCLUDE_XPTR_FAILED = 1612
7715XML_XINCLUDE_XPTR_RESULT = 1613
7716XML_XINCLUDE_INCLUDE_IN_INCLUDE = 1614
7717XML_XINCLUDE_FALLBACKS_IN_INCLUDE = 1615
7718XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE = 1616
7719XML_XINCLUDE_DEPRECATED_NS = 1617
7720XML_XINCLUDE_FRAGMENT_ID = 1618
7721XML_CATALOG_MISSING_ATTR = 1650
7722XML_CATALOG_ENTRY_BROKEN = 1651
7723XML_CATALOG_PREFER_VALUE = 1652
7724XML_CATALOG_NOT_CATALOG = 1653
7725XML_CATALOG_RECURSION = 1654
7726XML_SCHEMAP_PREFIX_UNDEFINED = 1700
7727XML_SCHEMAP_ATTRFORMDEFAULT_VALUE = 1701
7728XML_SCHEMAP_ATTRGRP_NONAME_NOREF = 1702
7729XML_SCHEMAP_ATTR_NONAME_NOREF = 1703
7730XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF = 1704
7731XML_SCHEMAP_ELEMFORMDEFAULT_VALUE = 1705
7732XML_SCHEMAP_ELEM_NONAME_NOREF = 1706
7733XML_SCHEMAP_EXTENSION_NO_BASE = 1707
7734XML_SCHEMAP_FACET_NO_VALUE = 1708
7735XML_SCHEMAP_FAILED_BUILD_IMPORT = 1709
7736XML_SCHEMAP_GROUP_NONAME_NOREF = 1710
7737XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI = 1711
7738XML_SCHEMAP_IMPORT_REDEFINE_NSNAME = 1712
7739XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI = 1713
7740XML_SCHEMAP_INVALID_BOOLEAN = 1714
7741XML_SCHEMAP_INVALID_ENUM = 1715
7742XML_SCHEMAP_INVALID_FACET = 1716
7743XML_SCHEMAP_INVALID_FACET_VALUE = 1717
7744XML_SCHEMAP_INVALID_MAXOCCURS = 1718
7745XML_SCHEMAP_INVALID_MINOCCURS = 1719
7746XML_SCHEMAP_INVALID_REF_AND_SUBTYPE = 1720
7747XML_SCHEMAP_INVALID_WHITE_SPACE = 1721
7748XML_SCHEMAP_NOATTR_NOREF = 1722
7749XML_SCHEMAP_NOTATION_NO_NAME = 1723
7750XML_SCHEMAP_NOTYPE_NOREF = 1724
7751XML_SCHEMAP_REF_AND_SUBTYPE = 1725
7752XML_SCHEMAP_RESTRICTION_NONAME_NOREF = 1726
7753XML_SCHEMAP_SIMPLETYPE_NONAME = 1727
7754XML_SCHEMAP_TYPE_AND_SUBTYPE = 1728
7755XML_SCHEMAP_UNKNOWN_ALL_CHILD = 1729
7756XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD = 1730
7757XML_SCHEMAP_UNKNOWN_ATTR_CHILD = 1731
7758XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD = 1732
7759XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP = 1733
7760XML_SCHEMAP_UNKNOWN_BASE_TYPE = 1734
7761XML_SCHEMAP_UNKNOWN_CHOICE_CHILD = 1735
7762XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD = 1736
7763XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD = 1737
7764XML_SCHEMAP_UNKNOWN_ELEM_CHILD = 1738
7765XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD = 1739
7766XML_SCHEMAP_UNKNOWN_FACET_CHILD = 1740
7767XML_SCHEMAP_UNKNOWN_FACET_TYPE = 1741
7768XML_SCHEMAP_UNKNOWN_GROUP_CHILD = 1742
7769XML_SCHEMAP_UNKNOWN_IMPORT_CHILD = 1743
7770XML_SCHEMAP_UNKNOWN_LIST_CHILD = 1744
7771XML_SCHEMAP_UNKNOWN_NOTATION_CHILD = 1745
7772XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD = 1746
7773XML_SCHEMAP_UNKNOWN_REF = 1747
7774XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD = 1748
7775XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD = 1749
7776XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD = 1750
7777XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD = 1751
7778XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD = 1752
7779XML_SCHEMAP_UNKNOWN_TYPE = 1753
7780XML_SCHEMAP_UNKNOWN_UNION_CHILD = 1754
7781XML_SCHEMAP_ELEM_DEFAULT_FIXED = 1755
7782XML_SCHEMAP_REGEXP_INVALID = 1756
7783XML_SCHEMAP_FAILED_LOAD = 1757
7784XML_SCHEMAP_NOTHING_TO_PARSE = 1758
7785XML_SCHEMAP_NOROOT = 1759
7786XML_SCHEMAP_REDEFINED_GROUP = 1760
7787XML_SCHEMAP_REDEFINED_TYPE = 1761
7788XML_SCHEMAP_REDEFINED_ELEMENT = 1762
7789XML_SCHEMAP_REDEFINED_ATTRGROUP = 1763
7790XML_SCHEMAP_REDEFINED_ATTR = 1764
7791XML_SCHEMAP_REDEFINED_NOTATION = 1765
7792XML_SCHEMAP_FAILED_PARSE = 1766
7793XML_SCHEMAP_UNKNOWN_PREFIX = 1767
7794XML_SCHEMAP_DEF_AND_PREFIX = 1768
7795XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD = 1769
7796XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI = 1770
7797XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI = 1771
7798XML_SCHEMAP_NOT_SCHEMA = 1772
7799XML_SCHEMAP_UNKNOWN_MEMBER_TYPE = 1773
7800XML_SCHEMAP_INVALID_ATTR_USE = 1774
7801XML_SCHEMAP_RECURSIVE = 1775
7802XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE = 1776
7803XML_SCHEMAP_INVALID_ATTR_COMBINATION = 1777
7804XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION = 1778
7805XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD = 1779
7806XML_SCHEMAP_INVALID_ATTR_NAME = 1780
7807XML_SCHEMAP_REF_AND_CONTENT = 1781
7808XML_SCHEMAP_CT_PROPS_CORRECT_1 = 1782
7809XML_SCHEMAP_CT_PROPS_CORRECT_2 = 1783
7810XML_SCHEMAP_CT_PROPS_CORRECT_3 = 1784
7811XML_SCHEMAP_CT_PROPS_CORRECT_4 = 1785
7812XML_SCHEMAP_CT_PROPS_CORRECT_5 = 1786
7813XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1 = 1787
7814XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1 = 1788
7815XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2 = 1789
7816XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2 = 1790
7817XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3 = 1791
7818XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER = 1792
7819XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE = 1793
7820XML_SCHEMAP_UNION_NOT_EXPRESSIBLE = 1794
7821XML_SCHEMAP_SRC_IMPORT_3_1 = 1795
7822XML_SCHEMAP_SRC_IMPORT_3_2 = 1796
7823XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1 = 1797
7824XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2 = 1798
7825XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3 = 1799
7826XML_SCHEMAP_COS_CT_EXTENDS_1_3 = 1800
7827XML_SCHEMAV_NOROOT = 1801
7828XML_SCHEMAV_UNDECLAREDELEM = 1802
7829XML_SCHEMAV_NOTTOPLEVEL = 1803
7830XML_SCHEMAV_MISSING = 1804
7831XML_SCHEMAV_WRONGELEM = 1805
7832XML_SCHEMAV_NOTYPE = 1806
7833XML_SCHEMAV_NOROLLBACK = 1807
7834XML_SCHEMAV_ISABSTRACT = 1808
7835XML_SCHEMAV_NOTEMPTY = 1809
7836XML_SCHEMAV_ELEMCONT = 1810
7837XML_SCHEMAV_HAVEDEFAULT = 1811
7838XML_SCHEMAV_NOTNILLABLE = 1812
7839XML_SCHEMAV_EXTRACONTENT = 1813
7840XML_SCHEMAV_INVALIDATTR = 1814
7841XML_SCHEMAV_INVALIDELEM = 1815
7842XML_SCHEMAV_NOTDETERMINIST = 1816
7843XML_SCHEMAV_CONSTRUCT = 1817
7844XML_SCHEMAV_INTERNAL = 1818
7845XML_SCHEMAV_NOTSIMPLE = 1819
7846XML_SCHEMAV_ATTRUNKNOWN = 1820
7847XML_SCHEMAV_ATTRINVALID = 1821
7848XML_SCHEMAV_VALUE = 1822
7849XML_SCHEMAV_FACET = 1823
7850XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1 = 1824
7851XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2 = 1825
7852XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3 = 1826
7853XML_SCHEMAV_CVC_TYPE_3_1_1 = 1827
7854XML_SCHEMAV_CVC_TYPE_3_1_2 = 1828
7855XML_SCHEMAV_CVC_FACET_VALID = 1829
7856XML_SCHEMAV_CVC_LENGTH_VALID = 1830
7857XML_SCHEMAV_CVC_MINLENGTH_VALID = 1831
7858XML_SCHEMAV_CVC_MAXLENGTH_VALID = 1832
7859XML_SCHEMAV_CVC_MININCLUSIVE_VALID = 1833
7860XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID = 1834
7861XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID = 1835
7862XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID = 1836
7863XML_SCHEMAV_CVC_TOTALDIGITS_VALID = 1837
7864XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID = 1838
7865XML_SCHEMAV_CVC_PATTERN_VALID = 1839
7866XML_SCHEMAV_CVC_ENUMERATION_VALID = 1840
7867XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1 = 1841
7868XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2 = 1842
7869XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3 = 1843
7870XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4 = 1844
7871XML_SCHEMAV_CVC_ELT_1 = 1845
7872XML_SCHEMAV_CVC_ELT_2 = 1846
7873XML_SCHEMAV_CVC_ELT_3_1 = 1847
7874XML_SCHEMAV_CVC_ELT_3_2_1 = 1848
7875XML_SCHEMAV_CVC_ELT_3_2_2 = 1849
7876XML_SCHEMAV_CVC_ELT_4_1 = 1850
7877XML_SCHEMAV_CVC_ELT_4_2 = 1851
7878XML_SCHEMAV_CVC_ELT_4_3 = 1852
7879XML_SCHEMAV_CVC_ELT_5_1_1 = 1853
7880XML_SCHEMAV_CVC_ELT_5_1_2 = 1854
7881XML_SCHEMAV_CVC_ELT_5_2_1 = 1855
7882XML_SCHEMAV_CVC_ELT_5_2_2_1 = 1856
7883XML_SCHEMAV_CVC_ELT_5_2_2_2_1 = 1857
7884XML_SCHEMAV_CVC_ELT_5_2_2_2_2 = 1858
7885XML_SCHEMAV_CVC_ELT_6 = 1859
7886XML_SCHEMAV_CVC_ELT_7 = 1860
7887XML_SCHEMAV_CVC_ATTRIBUTE_1 = 1861
7888XML_SCHEMAV_CVC_ATTRIBUTE_2 = 1862
7889XML_SCHEMAV_CVC_ATTRIBUTE_3 = 1863
7890XML_SCHEMAV_CVC_ATTRIBUTE_4 = 1864
7891XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1 = 1865
7892XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1 = 1866
7893XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2 = 1867
7894XML_SCHEMAV_CVC_COMPLEX_TYPE_4 = 1868
7895XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1 = 1869
7896XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2 = 1870
7897XML_SCHEMAV_ELEMENT_CONTENT = 1871
7898XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING = 1872
7899XML_SCHEMAV_CVC_COMPLEX_TYPE_1 = 1873
7900XML_SCHEMAV_CVC_AU = 1874
7901XML_SCHEMAV_CVC_TYPE_1 = 1875
7902XML_SCHEMAV_CVC_TYPE_2 = 1876
7903XML_SCHEMAV_CVC_IDC = 1877
7904XML_SCHEMAV_CVC_WILDCARD = 1878
7905XML_SCHEMAV_MISC = 1879
7906XML_XPTR_UNKNOWN_SCHEME = 1900
7907XML_XPTR_CHILDSEQ_START = 1901
7908XML_XPTR_EVAL_FAILED = 1902
7909XML_XPTR_EXTRA_OBJECTS = 1903
7910XML_C14N_CREATE_CTXT = 1950
7911XML_C14N_REQUIRES_UTF8 = 1951
7912XML_C14N_CREATE_STACK = 1952
7913XML_C14N_INVALID_NODE = 1953
7914XML_C14N_UNKNOW_NODE = 1954
7915XML_C14N_RELATIVE_NAMESPACE = 1955
7916XML_FTP_PASV_ANSWER = 2000
7917XML_FTP_EPSV_ANSWER = 2001
7918XML_FTP_ACCNT = 2002
7919XML_FTP_URL_SYNTAX = 2003
7920XML_HTTP_URL_SYNTAX = 2020
7921XML_HTTP_USE_IP = 2021
7922XML_HTTP_UNKNOWN_HOST = 2022
7923XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000
7924XML_SCHEMAP_SRC_SIMPLE_TYPE_2 = 3001
7925XML_SCHEMAP_SRC_SIMPLE_TYPE_3 = 3002
7926XML_SCHEMAP_SRC_SIMPLE_TYPE_4 = 3003
7927XML_SCHEMAP_SRC_RESOLVE = 3004
7928XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE = 3005
7929XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE = 3006
7930XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES = 3007
7931XML_SCHEMAP_ST_PROPS_CORRECT_1 = 3008
7932XML_SCHEMAP_ST_PROPS_CORRECT_2 = 3009
7933XML_SCHEMAP_ST_PROPS_CORRECT_3 = 3010
7934XML_SCHEMAP_COS_ST_RESTRICTS_1_1 = 3011
7935XML_SCHEMAP_COS_ST_RESTRICTS_1_2 = 3012
7936XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1 = 3013
7937XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2 = 3014
7938XML_SCHEMAP_COS_ST_RESTRICTS_2_1 = 3015
7939XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1 = 3016
7940XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2 = 3017
7941XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1 = 3018
7942XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2 = 3019
7943XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3 = 3020
7944XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4 = 3021
7945XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5 = 3022
7946XML_SCHEMAP_COS_ST_RESTRICTS_3_1 = 3023
7947XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1 = 3024
7948XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2 = 3025
7949XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2 = 3026
7950XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1 = 3027
7951XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3 = 3028
7952XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4 = 3029
7953XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5 = 3030
7954XML_SCHEMAP_COS_ST_DERIVED_OK_2_1 = 3031
7955XML_SCHEMAP_COS_ST_DERIVED_OK_2_2 = 3032
7956XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED = 3033
7957XML_SCHEMAP_S4S_ELEM_MISSING = 3034
7958XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED = 3035
7959XML_SCHEMAP_S4S_ATTR_MISSING = 3036
7960XML_SCHEMAP_S4S_ATTR_INVALID_VALUE = 3037
7961XML_SCHEMAP_SRC_ELEMENT_1 = 3038
7962XML_SCHEMAP_SRC_ELEMENT_2_1 = 3039
7963XML_SCHEMAP_SRC_ELEMENT_2_2 = 3040
7964XML_SCHEMAP_SRC_ELEMENT_3 = 3041
7965XML_SCHEMAP_P_PROPS_CORRECT_1 = 3042
7966XML_SCHEMAP_P_PROPS_CORRECT_2_1 = 3043
7967XML_SCHEMAP_P_PROPS_CORRECT_2_2 = 3044
7968XML_SCHEMAP_E_PROPS_CORRECT_2 = 3045
7969XML_SCHEMAP_E_PROPS_CORRECT_3 = 3046
7970XML_SCHEMAP_E_PROPS_CORRECT_4 = 3047
7971XML_SCHEMAP_E_PROPS_CORRECT_5 = 3048
7972XML_SCHEMAP_E_PROPS_CORRECT_6 = 3049
7973XML_SCHEMAP_SRC_INCLUDE = 3050
7974XML_SCHEMAP_SRC_ATTRIBUTE_1 = 3051
7975XML_SCHEMAP_SRC_ATTRIBUTE_2 = 3052
7976XML_SCHEMAP_SRC_ATTRIBUTE_3_1 = 3053
7977XML_SCHEMAP_SRC_ATTRIBUTE_3_2 = 3054
7978XML_SCHEMAP_SRC_ATTRIBUTE_4 = 3055
7979XML_SCHEMAP_NO_XMLNS = 3056
7980XML_SCHEMAP_NO_XSI = 3057
7981XML_SCHEMAP_COS_VALID_DEFAULT_1 = 3058
7982XML_SCHEMAP_COS_VALID_DEFAULT_2_1 = 3059
7983XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1 = 3060
7984XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2 = 3061
7985XML_SCHEMAP_CVC_SIMPLE_TYPE = 3062
7986XML_SCHEMAP_COS_CT_EXTENDS_1_1 = 3063
7987XML_SCHEMAP_SRC_IMPORT_1_1 = 3064
7988XML_SCHEMAP_SRC_IMPORT_1_2 = 3065
7989XML_SCHEMAP_SRC_IMPORT_2 = 3066
7990XML_SCHEMAP_SRC_IMPORT_2_1 = 3067
7991XML_SCHEMAP_SRC_IMPORT_2_2 = 3068
7992XML_SCHEMAP_INTERNAL = 3069
7993XML_SCHEMAP_NOT_DETERMINISTIC = 3070
7994XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1 = 3071
7995XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2 = 3072
7996XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3 = 3073
7997XML_SCHEMAP_MG_PROPS_CORRECT_1 = 3074
7998XML_SCHEMAP_MG_PROPS_CORRECT_2 = 3075
7999XML_SCHEMAP_SRC_CT_1 = 3076
8000XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3 = 3077
8001XML_SCHEMAP_AU_PROPS_CORRECT_2 = 3078
8002XML_SCHEMAP_A_PROPS_CORRECT_2 = 3079
8003XML_SCHEMAP_C_PROPS_CORRECT = 3080
8004XML_SCHEMAP_SRC_REDEFINE = 3081
8005XML_SCHEMAP_SRC_IMPORT = 3082
8006XML_SCHEMAP_WARN_SKIP_SCHEMA = 3083
8007XML_SCHEMAP_WARN_UNLOCATED_SCHEMA = 3084
8008XML_SCHEMAP_WARN_ATTR_REDECL_PROH = 3085
8009XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH = 3086
8010XML_SCHEMAP_AG_PROPS_CORRECT = 3087
8011XML_SCHEMAP_COS_CT_EXTENDS_1_2 = 3088
8012XML_SCHEMAP_AU_PROPS_CORRECT = 3089
8013XML_SCHEMAP_A_PROPS_CORRECT_3 = 3090
8014XML_SCHEMAP_COS_ALL_LIMITED = 3091
8015XML_SCHEMATRONV_ASSERT = 4000
8016XML_SCHEMATRONV_REPORT = 4001
8017XML_MODULE_OPEN = 4900
8018XML_MODULE_CLOSE = 4901
8019XML_CHECK_FOUND_ELEMENT = 5000
8020XML_CHECK_FOUND_ATTRIBUTE = 5001
8021XML_CHECK_FOUND_TEXT = 5002
8022XML_CHECK_FOUND_CDATA = 5003
8023XML_CHECK_FOUND_ENTITYREF = 5004
8024XML_CHECK_FOUND_ENTITY = 5005
8025XML_CHECK_FOUND_PI = 5006
8026XML_CHECK_FOUND_COMMENT = 5007
8027XML_CHECK_FOUND_DOCTYPE = 5008
8028XML_CHECK_FOUND_FRAGMENT = 5009
8029XML_CHECK_FOUND_NOTATION = 5010
8030XML_CHECK_UNKNOWN_NODE = 5011
8031XML_CHECK_ENTITY_TYPE = 5012
8032XML_CHECK_NO_PARENT = 5013
8033XML_CHECK_NO_DOC = 5014
8034XML_CHECK_NO_NAME = 5015
8035XML_CHECK_NO_ELEM = 5016
8036XML_CHECK_WRONG_DOC = 5017
8037XML_CHECK_NO_PREV = 5018
8038XML_CHECK_WRONG_PREV = 5019
8039XML_CHECK_NO_NEXT = 5020
8040XML_CHECK_WRONG_NEXT = 5021
8041XML_CHECK_NOT_DTD = 5022
8042XML_CHECK_NOT_ATTR = 5023
8043XML_CHECK_NOT_ATTR_DECL = 5024
8044XML_CHECK_NOT_ELEM_DECL = 5025
8045XML_CHECK_NOT_ENTITY_DECL = 5026
8046XML_CHECK_NOT_NS_DECL = 5027
8047XML_CHECK_NO_HREF = 5028
8048XML_CHECK_WRONG_PARENT = 5029
8049XML_CHECK_NS_SCOPE = 5030
8050XML_CHECK_NS_ANCESTOR = 5031
8051XML_CHECK_NOT_UTF8 = 5032
8052XML_CHECK_NO_DICT = 5033
8053XML_CHECK_NOT_NCNAME = 5034
8054XML_CHECK_OUTSIDE_DICT = 5035
8055XML_CHECK_WRONG_NAME = 5036
8056XML_CHECK_NAME_NOT_NULL = 5037
8057XML_I18N_NO_NAME = 6000
8058XML_I18N_NO_HANDLER = 6001
8059XML_I18N_EXCESS_HANDLER = 6002
8060XML_I18N_CONV_FAILED = 6003
8061XML_I18N_NO_OUTPUT = 6004
8062XML_BUF_OVERFLOW = 7000
8063
8064# xmlExpNodeType
8065XML_EXP_EMPTY = 0
8066XML_EXP_FORBID = 1
8067XML_EXP_ATOM = 2
8068XML_EXP_SEQ = 3
8069XML_EXP_OR = 4
8070XML_EXP_COUNT = 5
8071
8072# xmlElementContentType
8073XML_ELEMENT_CONTENT_PCDATA = 1
8074XML_ELEMENT_CONTENT_ELEMENT = 2
8075XML_ELEMENT_CONTENT_SEQ = 3
8076XML_ELEMENT_CONTENT_OR = 4
8077
8078# xmlParserProperties
8079XML_PARSER_LOADDTD = 1
8080XML_PARSER_DEFAULTATTRS = 2
8081XML_PARSER_VALIDATE = 3
8082XML_PARSER_SUBST_ENTITIES = 4
8083
8084# xmlReaderTypes
8085XML_READER_TYPE_NONE = 0
8086XML_READER_TYPE_ELEMENT = 1
8087XML_READER_TYPE_ATTRIBUTE = 2
8088XML_READER_TYPE_TEXT = 3
8089XML_READER_TYPE_CDATA = 4
8090XML_READER_TYPE_ENTITY_REFERENCE = 5
8091XML_READER_TYPE_ENTITY = 6
8092XML_READER_TYPE_PROCESSING_INSTRUCTION = 7
8093XML_READER_TYPE_COMMENT = 8
8094XML_READER_TYPE_DOCUMENT = 9
8095XML_READER_TYPE_DOCUMENT_TYPE = 10
8096XML_READER_TYPE_DOCUMENT_FRAGMENT = 11
8097XML_READER_TYPE_NOTATION = 12
8098XML_READER_TYPE_WHITESPACE = 13
8099XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14
8100XML_READER_TYPE_END_ELEMENT = 15
8101XML_READER_TYPE_END_ENTITY = 16
8102XML_READER_TYPE_XML_DECLARATION = 17
8103
8104# xmlCatalogPrefer
8105XML_CATA_PREFER_NONE = 0
8106XML_CATA_PREFER_PUBLIC = 1
8107XML_CATA_PREFER_SYSTEM = 2
8108
8109# xmlElementType
8110XML_ELEMENT_NODE = 1
8111XML_ATTRIBUTE_NODE = 2
8112XML_TEXT_NODE = 3
8113XML_CDATA_SECTION_NODE = 4
8114XML_ENTITY_REF_NODE = 5
8115XML_ENTITY_NODE = 6
8116XML_PI_NODE = 7
8117XML_COMMENT_NODE = 8
8118XML_DOCUMENT_NODE = 9
8119XML_DOCUMENT_TYPE_NODE = 10
8120XML_DOCUMENT_FRAG_NODE = 11
8121XML_NOTATION_NODE = 12
8122XML_HTML_DOCUMENT_NODE = 13
8123XML_DTD_NODE = 14
8124XML_ELEMENT_DECL = 15
8125XML_ATTRIBUTE_DECL = 16
8126XML_ENTITY_DECL = 17
8127XML_NAMESPACE_DECL = 18
8128XML_XINCLUDE_START = 19
8129XML_XINCLUDE_END = 20
8130XML_DOCB_DOCUMENT_NODE = 21
8131
8132# xlinkActuate
8133XLINK_ACTUATE_NONE = 0
8134XLINK_ACTUATE_AUTO = 1
8135XLINK_ACTUATE_ONREQUEST = 2
8136
8137# xmlFeature
8138XML_WITH_THREAD = 1
8139XML_WITH_TREE = 2
8140XML_WITH_OUTPUT = 3
8141XML_WITH_PUSH = 4
8142XML_WITH_READER = 5
8143XML_WITH_PATTERN = 6
8144XML_WITH_WRITER = 7
8145XML_WITH_SAX1 = 8
8146XML_WITH_FTP = 9
8147XML_WITH_HTTP = 10
8148XML_WITH_VALID = 11
8149XML_WITH_HTML = 12
8150XML_WITH_LEGACY = 13
8151XML_WITH_C14N = 14
8152XML_WITH_CATALOG = 15
8153XML_WITH_XPATH = 16
8154XML_WITH_XPTR = 17
8155XML_WITH_XINCLUDE = 18
8156XML_WITH_ICONV = 19
8157XML_WITH_ISO8859X = 20
8158XML_WITH_UNICODE = 21
8159XML_WITH_REGEXP = 22
8160XML_WITH_AUTOMATA = 23
8161XML_WITH_EXPR = 24
8162XML_WITH_SCHEMAS = 25
8163XML_WITH_SCHEMATRON = 26
8164XML_WITH_MODULES = 27
8165XML_WITH_DEBUG = 28
8166XML_WITH_DEBUG_MEM = 29
8167XML_WITH_DEBUG_RUN = 30
8168XML_WITH_ZLIB = 31
8169XML_WITH_ICU = 32
8170XML_WITH_LZMA = 33
8171XML_WITH_NONE = 99999
8172
8173# xmlElementContentOccur
8174XML_ELEMENT_CONTENT_ONCE = 1
8175XML_ELEMENT_CONTENT_OPT = 2
8176XML_ELEMENT_CONTENT_MULT = 3
8177XML_ELEMENT_CONTENT_PLUS = 4
8178
8179# xmlXPathError
8180XPATH_EXPRESSION_OK = 0
8181XPATH_NUMBER_ERROR = 1
8182XPATH_UNFINISHED_LITERAL_ERROR = 2
8183XPATH_START_LITERAL_ERROR = 3
8184XPATH_VARIABLE_REF_ERROR = 4
8185XPATH_UNDEF_VARIABLE_ERROR = 5
8186XPATH_INVALID_PREDICATE_ERROR = 6
8187XPATH_EXPR_ERROR = 7
8188XPATH_UNCLOSED_ERROR = 8
8189XPATH_UNKNOWN_FUNC_ERROR = 9
8190XPATH_INVALID_OPERAND = 10
8191XPATH_INVALID_TYPE = 11
8192XPATH_INVALID_ARITY = 12
8193XPATH_INVALID_CTXT_SIZE = 13
8194XPATH_INVALID_CTXT_POSITION = 14
8195XPATH_MEMORY_ERROR = 15
8196XPTR_SYNTAX_ERROR = 16
8197XPTR_RESOURCE_ERROR = 17
8198XPTR_SUB_RESOURCE_ERROR = 18
8199XPATH_UNDEF_PREFIX_ERROR = 19
8200XPATH_ENCODING_ERROR = 20
8201XPATH_INVALID_CHAR_ERROR = 21
8202XPATH_INVALID_CTXT = 22
8203XPATH_STACK_ERROR = 23
8204XPATH_FORBID_VARIABLE_ERROR = 24
8205
8206# xmlTextReaderMode
8207XML_TEXTREADER_MODE_INITIAL = 0
8208XML_TEXTREADER_MODE_INTERACTIVE = 1
8209XML_TEXTREADER_MODE_ERROR = 2
8210XML_TEXTREADER_MODE_EOF = 3
8211XML_TEXTREADER_MODE_CLOSED = 4
8212XML_TEXTREADER_MODE_READING = 5
8213
8214# xmlErrorLevel
8215XML_ERR_NONE = 0
8216XML_ERR_WARNING = 1
8217XML_ERR_ERROR = 2
8218XML_ERR_FATAL = 3
8219
8220# xmlCharEncoding
8221XML_CHAR_ENCODING_ERROR = -1
8222XML_CHAR_ENCODING_NONE = 0
8223XML_CHAR_ENCODING_UTF8 = 1
8224XML_CHAR_ENCODING_UTF16LE = 2
8225XML_CHAR_ENCODING_UTF16BE = 3
8226XML_CHAR_ENCODING_UCS4LE = 4
8227XML_CHAR_ENCODING_UCS4BE = 5
8228XML_CHAR_ENCODING_EBCDIC = 6
8229XML_CHAR_ENCODING_UCS4_2143 = 7
8230XML_CHAR_ENCODING_UCS4_3412 = 8
8231XML_CHAR_ENCODING_UCS2 = 9
8232XML_CHAR_ENCODING_8859_1 = 10
8233XML_CHAR_ENCODING_8859_2 = 11
8234XML_CHAR_ENCODING_8859_3 = 12
8235XML_CHAR_ENCODING_8859_4 = 13
8236XML_CHAR_ENCODING_8859_5 = 14
8237XML_CHAR_ENCODING_8859_6 = 15
8238XML_CHAR_ENCODING_8859_7 = 16
8239XML_CHAR_ENCODING_8859_8 = 17
8240XML_CHAR_ENCODING_8859_9 = 18
8241XML_CHAR_ENCODING_2022_JP = 19
8242XML_CHAR_ENCODING_SHIFT_JIS = 20
8243XML_CHAR_ENCODING_EUC_JP = 21
8244XML_CHAR_ENCODING_ASCII = 22
8245
8246# xmlErrorDomain
8247XML_FROM_NONE = 0
8248XML_FROM_PARSER = 1
8249XML_FROM_TREE = 2
8250XML_FROM_NAMESPACE = 3
8251XML_FROM_DTD = 4
8252XML_FROM_HTML = 5
8253XML_FROM_MEMORY = 6
8254XML_FROM_OUTPUT = 7
8255XML_FROM_IO = 8
8256XML_FROM_FTP = 9
8257XML_FROM_HTTP = 10
8258XML_FROM_XINCLUDE = 11
8259XML_FROM_XPATH = 12
8260XML_FROM_XPOINTER = 13
8261XML_FROM_REGEXP = 14
8262XML_FROM_DATATYPE = 15
8263XML_FROM_SCHEMASP = 16
8264XML_FROM_SCHEMASV = 17
8265XML_FROM_RELAXNGP = 18
8266XML_FROM_RELAXNGV = 19
8267XML_FROM_CATALOG = 20
8268XML_FROM_C14N = 21
8269XML_FROM_XSLT = 22
8270XML_FROM_VALID = 23
8271XML_FROM_CHECK = 24
8272XML_FROM_WRITER = 25
8273XML_FROM_MODULE = 26
8274XML_FROM_I18N = 27
8275XML_FROM_SCHEMATRONV = 28
8276XML_FROM_BUFFER = 29
8277XML_FROM_URI = 30
8278
8279# htmlStatus
8280HTML_NA = 0
8281HTML_INVALID = 1
8282HTML_DEPRECATED = 2
8283HTML_VALID = 4
8284HTML_REQUIRED = 12
8285
8286# xmlSchemaValidOption
8287XML_SCHEMA_VAL_VC_I_CREATE = 1
8288
8289# xmlSchemaWhitespaceValueType
8290XML_SCHEMA_WHITESPACE_UNKNOWN = 0
8291XML_SCHEMA_WHITESPACE_PRESERVE = 1
8292XML_SCHEMA_WHITESPACE_REPLACE = 2
8293XML_SCHEMA_WHITESPACE_COLLAPSE = 3
8294
8295# htmlParserOption
8296HTML_PARSE_RECOVER = 1
8297HTML_PARSE_NODEFDTD = 4
8298HTML_PARSE_NOERROR = 32
8299HTML_PARSE_NOWARNING = 64
8300HTML_PARSE_PEDANTIC = 128
8301HTML_PARSE_NOBLANKS = 256
8302HTML_PARSE_NONET = 2048
8303HTML_PARSE_NOIMPLIED = 8192
8304HTML_PARSE_COMPACT = 65536
8305HTML_PARSE_IGNORE_ENC = 2097152
8306
8307# xmlRelaxNGValidErr
8308XML_RELAXNG_OK = 0
8309XML_RELAXNG_ERR_MEMORY = 1
8310XML_RELAXNG_ERR_TYPE = 2
8311XML_RELAXNG_ERR_TYPEVAL = 3
8312XML_RELAXNG_ERR_DUPID = 4
8313XML_RELAXNG_ERR_TYPECMP = 5
8314XML_RELAXNG_ERR_NOSTATE = 6
8315XML_RELAXNG_ERR_NODEFINE = 7
8316XML_RELAXNG_ERR_LISTEXTRA = 8
8317XML_RELAXNG_ERR_LISTEMPTY = 9
8318XML_RELAXNG_ERR_INTERNODATA = 10
8319XML_RELAXNG_ERR_INTERSEQ = 11
8320XML_RELAXNG_ERR_INTEREXTRA = 12
8321XML_RELAXNG_ERR_ELEMNAME = 13
8322XML_RELAXNG_ERR_ATTRNAME = 14
8323XML_RELAXNG_ERR_ELEMNONS = 15
8324XML_RELAXNG_ERR_ATTRNONS = 16
8325XML_RELAXNG_ERR_ELEMWRONGNS = 17
8326XML_RELAXNG_ERR_ATTRWRONGNS = 18
8327XML_RELAXNG_ERR_ELEMEXTRANS = 19
8328XML_RELAXNG_ERR_ATTREXTRANS = 20
8329XML_RELAXNG_ERR_ELEMNOTEMPTY = 21
8330XML_RELAXNG_ERR_NOELEM = 22
8331XML_RELAXNG_ERR_NOTELEM = 23
8332XML_RELAXNG_ERR_ATTRVALID = 24
8333XML_RELAXNG_ERR_CONTENTVALID = 25
8334XML_RELAXNG_ERR_EXTRACONTENT = 26
8335XML_RELAXNG_ERR_INVALIDATTR = 27
8336XML_RELAXNG_ERR_DATAELEM = 28
8337XML_RELAXNG_ERR_VALELEM = 29
8338XML_RELAXNG_ERR_LISTELEM = 30
8339XML_RELAXNG_ERR_DATATYPE = 31
8340XML_RELAXNG_ERR_VALUE = 32
8341XML_RELAXNG_ERR_LIST = 33
8342XML_RELAXNG_ERR_NOGRAMMAR = 34
8343XML_RELAXNG_ERR_EXTRADATA = 35
8344XML_RELAXNG_ERR_LACKDATA = 36
8345XML_RELAXNG_ERR_INTERNAL = 37
8346XML_RELAXNG_ERR_ELEMWRONG = 38
8347XML_RELAXNG_ERR_TEXTWRONG = 39
8348
8349# xmlCatalogAllow
8350XML_CATA_ALLOW_NONE = 0
8351XML_CATA_ALLOW_GLOBAL = 1
8352XML_CATA_ALLOW_DOCUMENT = 2
8353XML_CATA_ALLOW_ALL = 3
8354
8355# xmlAttributeType
8356XML_ATTRIBUTE_CDATA = 1
8357XML_ATTRIBUTE_ID = 2
8358XML_ATTRIBUTE_IDREF = 3
8359XML_ATTRIBUTE_IDREFS = 4
8360XML_ATTRIBUTE_ENTITY = 5
8361XML_ATTRIBUTE_ENTITIES = 6
8362XML_ATTRIBUTE_NMTOKEN = 7
8363XML_ATTRIBUTE_NMTOKENS = 8
8364XML_ATTRIBUTE_ENUMERATION = 9
8365XML_ATTRIBUTE_NOTATION = 10
8366
8367# xmlSchematronValidOptions
8368XML_SCHEMATRON_OUT_QUIET = 1
8369XML_SCHEMATRON_OUT_TEXT = 2
8370XML_SCHEMATRON_OUT_XML = 4
8371XML_SCHEMATRON_OUT_ERROR = 8
8372XML_SCHEMATRON_OUT_FILE = 256
8373XML_SCHEMATRON_OUT_BUFFER = 512
8374XML_SCHEMATRON_OUT_IO = 1024
8375
8376# xmlSchemaContentType
8377XML_SCHEMA_CONTENT_UNKNOWN = 0
8378XML_SCHEMA_CONTENT_EMPTY = 1
8379XML_SCHEMA_CONTENT_ELEMENTS = 2
8380XML_SCHEMA_CONTENT_MIXED = 3
8381XML_SCHEMA_CONTENT_SIMPLE = 4
8382XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS = 5
8383XML_SCHEMA_CONTENT_BASIC = 6
8384XML_SCHEMA_CONTENT_ANY = 7
8385
8386# xmlSchemaTypeType
8387XML_SCHEMA_TYPE_BASIC = 1
8388XML_SCHEMA_TYPE_ANY = 2
8389XML_SCHEMA_TYPE_FACET = 3
8390XML_SCHEMA_TYPE_SIMPLE = 4
8391XML_SCHEMA_TYPE_COMPLEX = 5
8392XML_SCHEMA_TYPE_SEQUENCE = 6
8393XML_SCHEMA_TYPE_CHOICE = 7
8394XML_SCHEMA_TYPE_ALL = 8
8395XML_SCHEMA_TYPE_SIMPLE_CONTENT = 9
8396XML_SCHEMA_TYPE_COMPLEX_CONTENT = 10
8397XML_SCHEMA_TYPE_UR = 11
8398XML_SCHEMA_TYPE_RESTRICTION = 12
8399XML_SCHEMA_TYPE_EXTENSION = 13
8400XML_SCHEMA_TYPE_ELEMENT = 14
8401XML_SCHEMA_TYPE_ATTRIBUTE = 15
8402XML_SCHEMA_TYPE_ATTRIBUTEGROUP = 16
8403XML_SCHEMA_TYPE_GROUP = 17
8404XML_SCHEMA_TYPE_NOTATION = 18
8405XML_SCHEMA_TYPE_LIST = 19
8406XML_SCHEMA_TYPE_UNION = 20
8407XML_SCHEMA_TYPE_ANY_ATTRIBUTE = 21
8408XML_SCHEMA_TYPE_IDC_UNIQUE = 22
8409XML_SCHEMA_TYPE_IDC_KEY = 23
8410XML_SCHEMA_TYPE_IDC_KEYREF = 24
8411XML_SCHEMA_TYPE_PARTICLE = 25
8412XML_SCHEMA_TYPE_ATTRIBUTE_USE = 26
8413XML_SCHEMA_FACET_MININCLUSIVE = 1000
8414XML_SCHEMA_FACET_MINEXCLUSIVE = 1001
8415XML_SCHEMA_FACET_MAXINCLUSIVE = 1002
8416XML_SCHEMA_FACET_MAXEXCLUSIVE = 1003
8417XML_SCHEMA_FACET_TOTALDIGITS = 1004
8418XML_SCHEMA_FACET_FRACTIONDIGITS = 1005
8419XML_SCHEMA_FACET_PATTERN = 1006
8420XML_SCHEMA_FACET_ENUMERATION = 1007
8421XML_SCHEMA_FACET_WHITESPACE = 1008
8422XML_SCHEMA_FACET_LENGTH = 1009
8423XML_SCHEMA_FACET_MAXLENGTH = 1010
8424XML_SCHEMA_FACET_MINLENGTH = 1011
8425XML_SCHEMA_EXTRA_QNAMEREF = 2000
8426XML_SCHEMA_EXTRA_ATTR_USE_PROHIB = 2001
8427
8428# xmlModuleOption
8429XML_MODULE_LAZY = 1
8430XML_MODULE_LOCAL = 2
8431
8432# xmlParserMode
8433XML_PARSE_UNKNOWN = 0
8434XML_PARSE_DOM = 1
8435XML_PARSE_SAX = 2
8436XML_PARSE_PUSH_DOM = 3
8437XML_PARSE_PUSH_SAX = 4
8438XML_PARSE_READER = 5
8439
8440# xmlC14NMode
8441XML_C14N_1_0 = 0
8442XML_C14N_EXCLUSIVE_1_0 = 1
8443XML_C14N_1_1 = 2
8444
8445# xmlParserOption
8446XML_PARSE_RECOVER = 1
8447XML_PARSE_NOENT = 2
8448XML_PARSE_DTDLOAD = 4
8449XML_PARSE_DTDATTR = 8
8450XML_PARSE_DTDVALID = 16
8451XML_PARSE_NOERROR = 32
8452XML_PARSE_NOWARNING = 64
8453XML_PARSE_PEDANTIC = 128
8454XML_PARSE_NOBLANKS = 256
8455XML_PARSE_SAX1 = 512
8456XML_PARSE_XINCLUDE = 1024
8457XML_PARSE_NONET = 2048
8458XML_PARSE_NODICT = 4096
8459XML_PARSE_NSCLEAN = 8192
8460XML_PARSE_NOCDATA = 16384
8461XML_PARSE_NOXINCNODE = 32768
8462XML_PARSE_COMPACT = 65536
8463XML_PARSE_OLD10 = 131072
8464XML_PARSE_NOBASEFIX = 262144
8465XML_PARSE_HUGE = 524288
8466XML_PARSE_OLDSAX = 1048576
8467XML_PARSE_IGNORE_ENC = 2097152
8468XML_PARSE_BIG_LINES = 4194304
8469
8470# xmlElementTypeVal
8471XML_ELEMENT_TYPE_UNDEFINED = 0
8472XML_ELEMENT_TYPE_EMPTY = 1
8473XML_ELEMENT_TYPE_ANY = 2
8474XML_ELEMENT_TYPE_MIXED = 3
8475XML_ELEMENT_TYPE_ELEMENT = 4
8476
8477# xmlDocProperties
8478XML_DOC_WELLFORMED = 1
8479XML_DOC_NSVALID = 2
8480XML_DOC_OLD10 = 4
8481XML_DOC_DTDVALID = 8
8482XML_DOC_XINCLUDE = 16
8483XML_DOC_USERBUILT = 32
8484XML_DOC_INTERNAL = 64
8485XML_DOC_HTML = 128
8486
8487# xlinkType
8488XLINK_TYPE_NONE = 0
8489XLINK_TYPE_SIMPLE = 1
8490XLINK_TYPE_EXTENDED = 2
8491XLINK_TYPE_EXTENDED_SET = 3
8492
8493# xmlXPathObjectType
8494XPATH_UNDEFINED = 0
8495XPATH_NODESET = 1
8496XPATH_BOOLEAN = 2
8497XPATH_NUMBER = 3
8498XPATH_STRING = 4
8499XPATH_POINT = 5
8500XPATH_RANGE = 6
8501XPATH_LOCATIONSET = 7
8502XPATH_USERS = 8
8503XPATH_XSLT_TREE = 9
8504
8505# xmlSchemaValidError
8506XML_SCHEMAS_ERR_OK = 0
8507XML_SCHEMAS_ERR_NOROOT = 1
8508XML_SCHEMAS_ERR_UNDECLAREDELEM = 2
8509XML_SCHEMAS_ERR_NOTTOPLEVEL = 3
8510XML_SCHEMAS_ERR_MISSING = 4
8511XML_SCHEMAS_ERR_WRONGELEM = 5
8512XML_SCHEMAS_ERR_NOTYPE = 6
8513XML_SCHEMAS_ERR_NOROLLBACK = 7
8514XML_SCHEMAS_ERR_ISABSTRACT = 8
8515XML_SCHEMAS_ERR_NOTEMPTY = 9
8516XML_SCHEMAS_ERR_ELEMCONT = 10
8517XML_SCHEMAS_ERR_HAVEDEFAULT = 11
8518XML_SCHEMAS_ERR_NOTNILLABLE = 12
8519XML_SCHEMAS_ERR_EXTRACONTENT = 13
8520XML_SCHEMAS_ERR_INVALIDATTR = 14
8521XML_SCHEMAS_ERR_INVALIDELEM = 15
8522XML_SCHEMAS_ERR_NOTDETERMINIST = 16
8523XML_SCHEMAS_ERR_CONSTRUCT = 17
8524XML_SCHEMAS_ERR_INTERNAL = 18
8525XML_SCHEMAS_ERR_NOTSIMPLE = 19
8526XML_SCHEMAS_ERR_ATTRUNKNOWN = 20
8527XML_SCHEMAS_ERR_ATTRINVALID = 21
8528XML_SCHEMAS_ERR_VALUE = 22
8529XML_SCHEMAS_ERR_FACET = 23
8530XML_SCHEMAS_ERR_ = 24
8531XML_SCHEMAS_ERR_XXX = 25
8532
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette