[Tutor] XML: Expletive Deleted

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Jun 10 02:55:19 CEST 2006


>>> from xml.dom.minidom import parse, parseString
>
>>> data = response.read()
>>> connection.close()
>>> response = parseString(data)
>>> itemIDs = response.getElementsByTagName("ItemID")
>>> response.unlink()
     ^^^^^^^^^^^^^^^^^


Hi Doug,

What's going on here?  Why unlink()?



> Okay, no problem. Now all I have to do is figure out which 
> particlular.string.of.words.interconnected.by.periods to pass to extract 
> the values.
>
>>> for item in itemIDs:
>>>     print item.nodeValue


You may want to look at the minidom example here:

     http://www.python.org/doc/lib/dom-example.html

Does this help?


More information about the Tutor mailing list