is there a JDOM like library?

Martin von Loewis loewis at informatik.hu-berlin.de
Thu Aug 2 12:30:13 EDT 2001


"David" <david.perkinson at adtran.com> writes:

> Is there a DOM/XML GPL'd library for Python that is as easy to use as JDOM?
> Element root = doc.getRootElement();
> Element child = root.getChild("foo");
> String text = child.getText();

>>> from xml.dom.minidom import parseString
>>> doc = parseString("<foo>Hallo</foo>")
>>> root = doc.documentElement
>>> root.childNodes[0].nodeValue
u'Hallo'

Regards,
Martin



More information about the Python-list mailing list