Re: DOM parsing not working!

2008-03-08 Thread rbossy
Quoting Mike D <[EMAIL PROTECTED]>: > Hello, I've spent the morning trying to parse a simple xml file and have the > following: > import sys > from xml.dom import minidom > > doc=minidom.parse('topstories.xml') > > items = doc.getElementsByTagName("item") > text='' > for i in items: > t = i.fi

DOM parsing not working!

2008-03-07 Thread Mike D
Hello, I've spent the morning trying to parse a simple xml file and have the following: import sys from xml.dom import minidom doc=minidom.parse('topstories.xml') items = doc.getElementsByTagName("item") text='' for i in items: t = i.firstChild print t.nodeName if t.nodeType == t.TEXT