• Show log

    Commit

  • Hash : e32ceb93
    Author : Alexey Neyman
    Date : 2013-02-20T18:28:25

    Python bindings: DOM casts everything to xmlNode
    
    I noticed another issue with Python bindings of libxml: the access methods do
    not cast the pointers to specific classes such as xmlDtd, xmlEntityDecl, etc.
    For example, with the following document:
    
    <?xml version="1.0"?>
    <!DOCTYPE root [<!ELEMENT root EMPTY>]>
    <root/>
    
    the following script:
    
    import libxml2
    doc = libxml2.readFile("c.xml", None, libxml2.XML_PARSE_DTDLOAD)
    print repr(doc.children)
    
    prints:
    
    <xmlNode (root) object at 0xb74963ec>
    
    With properly cast nodes, it outputs the following:
    
    <xmlDtd (root) object at 0xb746352c>
    
    The latter object (xmlDtd) enables one to use DTD-specific methods such as
    debugDumpDTD(), copyDTD(), and so on.
    

  • README

  • 		Module libxml2-python
    		=====================
    
    This is the libxml2 python module, providing access to the
    libxml2 and libxslt (if available) libraries. For general
    informationss on those XML and XSLT libraries check their 
    web pages at :
        http://xmlsoft.org/
        and
        http://xmlsoft.org/XSLT/
    
    The latest version of the sources for this module and the
    associated libraries can be found at:
        ftp://xmlsoft.org/
    
    Binaries packages of the libxml2 and libxslt libraries can
    be found either on the FTP site for Linux, from external
    sources linked from the web pages, or as part of your set of
    packages provided with your operating system.
    
    NOTE:
    this module distribution is not the primary distribution
    of the libxml2 and libxslt Python binding code, but as 
    the Python way of packaging those for non-Linux systems.
    The main sources are the libxml2 and libxslt tar.gz found on
    the site. One side effect is that the official RPM packages for
    those modules are not generated from the libxml2-python
    distributions but as part of the normal RPM packaging of
    those two libraries.
    The RPM packages can be found at:
        http://rpmfind.net/linux/rpm2html/search.php?query=libxml2-python
        http://rpmfind.net/linux/rpm2html/search.php?query=libxslt-python
    
    Daniel Veillard