2004-09-16, 16:39
i'm trying to make a python script that parses an xml file. i implemented it using xml.dom.minidom and it works great when i run it on my pc using xbmc emulator. when i try to run the script on my xbox it doesn't start. here is a clip of my script...
is is so that i can't use dom in xbmc or is there something wrong with the code? (this is the first thing i'm coding with python)...
Quote: def parserss(self, url):
opener = urllib.fancyurlopener({})
f = opener.open(url)
xmldata = f.read()
dom = xml.dom.minidom.parsestring(xmldata)
self.updateitemlist(dom)
def updateitemlist(self, dom):
items = dom.getelementsbytagname("title")
for item in items:
self.itemlist.additem(self.gettext(item.childnodes))
def gettext(self, nodelist):
rc = ""
for node in nodelist:
if node.nodetype == node.text_node:
rc = rc + node.data
return rc
is is so that i can't use dom in xbmc or is there something wrong with the code? (this is the first thing i'm coding with python)...