Module libxml2
[hide private]
[frames] | no frames]

Source Code for Module libxml2

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