David Lucena wrote:

I've started to use PyXML because I needed a xml library for
> a tool I am making.

if you're writing new code, I strongly suggest using a library based on the ElementTree API instead of struggling with an old, unmaintained and rather unwieldy XML library.

if I'm reading things correctly, your entire example boils down to

    import xml.etree.ElementTree as ET

    elem = ET.Element("spam", eggs="sunny side up")
    elem.text = "some text here..."

    print ET.tostring(elem)

with the ET API.

The standard implementation of ET is included in Python 2.5 and later:

   http://docs.python.org/dev/library/xml.etree.elementtree.html

and is available for Python 1.5.2 and newer from here:

   http://effbot.org/zone/element-index.htm

and there's also a separate implementation based on the libxml2 and libxslt libraries, which adds validation and lots of other goodies:

   http://codespeak.net/lxml/

</F>

_______________________________________________
XML-SIG maillist  -  XML-SIG@python.org
http://mail.python.org/mailman/listinfo/xml-sig

Reply via email to