python from Java

Fredrik Lundh fredrik at pythonware.com
Tue Sep 7 17:47:57 CEST 2004


"Ajay" <abra9823 at mail.usyd.edu.au> wrote:

>> ElementTree
>> http://effbot.org/downloads/#elementtree
>
> okay i tried the above approaches but no luck. See the problem is an XML
> parser which works on a PDA - pythonce. Now elementtree uses pyexpat
> (which  pythonce doesn't have)

that's why ElementTree ships with several alternative tree builders;
from the README:

  SimpleXMLTreeBuilder.py
        Old element tree builder for XML, based on
        xmllib, for Python versions where "expat" is
        not available

usage:

    from elementtree import ElementTree, SimpleXMLTreeBuilder

    tree = ElementTree.parse(
        source, SimpleXMLTreeBuilder.TreeBuilder()
    )

note that xmllib has problems with namespaces on some versions
of Python; see the elementtree README for details.

</F> 






More information about the Python-list mailing list