Zameer Manji wrote: > I'm trying to extract some information from the following xml file: > http://pastebin.ca/1029125 >
> file = "Music.xml" > dict = plist.childNodes[1] #dict contains App version and stuff, as well You really should try to avoid rebinding built-in names, like dict and file, this is just asking for trouble. > The problem is that the Text node that is printed out is blank, when it > should be 42. What do I need to do so I can get tdict.childNodes[2] to > become a string being "42" ? I have not used minidom at all really, but here is an example using BeautifulSoup, perhaps you'll find it helpful: from BeautifulSoup import BeautifulStoneSoup class MusicSoup(BeautifulStoneSoup): NESTABLE_TAGS = { 'dict': [], 'array': [] } bsoup = MusicSoup(file('Music.xml')) print bsoup.dict.dict.key.string # 42 print bsoup.dict.dict.key.findNextSibling('key').string # 183 ... or ... tracks = bsoup.dict.dict.findChildren('key', recursive=False) print tracks for track in tracks: print track details = track.findNextSibling('dict') HTH, Marty _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor