[Tutor] help request from a newbie w/ problems parsing XML

Andy Osagie andy_osagie@hotmail.com
Wed Jun 4 17:40:02 2003


Hello,
I seem to have trouble editing the values of parsed XML documents so that I
can save them with my new values.


>>> from xml.dom import minidom
>>> doc = minidom.parseString("<entry>random stuff</entry>")
>>> doc.childNodes[0].toxml()
u'<entry>random stuff</entry>'
>>> doc.childNodes[0].nodeName
u'entry'
>>> doc.childNodes[0].nodeValue
>>> doc.childNodes[0].nodeName = "new"
>>> doc.childNodes[0].nodeValue = "test value"
>>> doc.childNodes[0].toxml()
u'<entry>random stuff</entry>'


I can't really figure out the problem. Is there any way to accomplish what
I've tried above? I'm trying to make a simple XML driven database.

Thanks in advance,
Andy Osagie