xml.dom.minidom question

John J. Lee jjl at pobox.com
Wed Oct 1 13:42:52 EDT 2003


"Greg Krohn" <ask at me.com> writes:

> "Geiregat Jonas" <eniac at sdf-eu.org> wrote in message
> news:3f79ad4b$0$10696$ba620e4c at reader2.news.skynet.be...
> > obj.getElementsByTagName("name")[0] then I have an object, but how can I
> > get the data between the tags ? I could do .toxml() and then strip it
[...]
> Given <name>Greg</name>, 'Greg' is considered an element inside the 'name'
> element. So, all you have to do is go one level of elements deeper.
> 
> myname = obj.getElementsByTagName("name")[0].childNodes[0].data

Might want to read up about normalization, too.


John




More information about the Python-list mailing list