home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 04_xap_libs.mo / usr / lib / python2.4 / site-packages / libxml2.py < prev    next >
Encoding:
Python Source  |  2005-04-11  |  319.5 KB  |  8,819 lines

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