XML Parsing, memory problem with minidom
#1
Hello,

I have problem with the memory used by the parsing of an XML file using minidom. I cannot release the used memory, and my script doesn't work well.

I found cElementTree (http://effbot.org/zone/celementtree.htm), but we can't use it in XBMC... Does somebody know where to find a compiled library or if sombody can do it for me, I haven't a pc with windows... and XDK

Thanks
Oliv
Reply
#2
I've had lots of memory issues with XML parsing myself and resorted to using regular expressions. waaaaay faster for hardly any mem usage. of course if the xml struct changes the regex breaks....
Retired from Add-on dev
Reply
#3
Oh... I have spent some much time to convert my configuration file to xml and then all regex accessing method to real dom function.... No Sad

So thanks for the advice...
Oliv


PS: concerning myTV, could you include the french switzerland channels TSR 1 & 2, in a french category with the channels from france and belgium for example, it would be nice...?
Reply
#4
I know XML is all the rage, but sometimes I think its a little to verbose for some situations.
eg. a config file that simply has key = value.

Which is why I chose to use the built in python ConfigParser, its simple to use and handles all read/writting etc.
Within the same file you can have multiple named Sections with its own key = value sets.
See mytv\system\config.dat for an example.

regarding myTV: The channels are dependant on what the datasource provides. Which datasource do you use or maybe theres a web site that could provide programme listings for channels you want ? (PM me or post in the mytv thread)
BBB
Retired from Add-on dev
Reply
#5
or get a sax parser.
Reply
#6
Thanks for your responses, but I finally found a version of ElementTree that works fine on XBMC and that is able to load my big xml file.

The use of Element tree requires just a few modification with minidom, and is easier to use...

I recommend it... Wink

>> http://effbot.org/downloads/elementtree-...050316.zip
Reply

Logout Mark Read Team Forum Stats Members Help
XML Parsing, memory problem with minidom0