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