"Simon Pickles" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > Can anyone suggest a really simple XML reader for python? I just want to > be able to do something like this: > > xmlDoc = xml.open("file.xml") > element = xmlDoc.GetElement("foo/bar") > > ... to read the value of: > > <foo> > <bar>42</bar> > </foo> > > > Thanks > > Simon > > -- > Linux user #458601 - http://counter.li.org. > > >
>>> from xml.etree import ElementTree as ET >>> tree=ET.parse('file.xml') >>> tree.find('bar').text '42' >>> --Mark -- http://mail.python.org/mailman/listinfo/python-list