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