I need help with some XML parsing I want to work on.
Basically, I'm saving a MU* database off to xml, then reading it back in, as a secondary storage measure. This is to get around the faster, simpler, but less intercompatible shelve module (yay different pickle and DBM formats bleah). It's not vital that I get this worked out right away, since shelve will provide the primary storage method, but I do still want to get this working at some point.
The data structure is a dictionary of dictionaries holding strings, lists, and even more dicts. Yes, complex, but doable. Maybe it'd be easier to just make everything class-based instead and write out all the get-and-set functions, but either way I still have to build and parse the XML documents.
Problem: Expat and xmllib are marked as depreciated in my library docs (for version 2.2.1). Therefore, I'm reluctant to use them.
Other problem: SAX looks like a pile of puzzle blocks to me, rather than a coherent solution. Maybe it's clear to someone who's been using it a while, but from what I see, there are too many options, too many ways of getting it wrong. That just seems terribly unPythonic in my mind. Besides which, the docs _seem_ to imply that I already knew to build a finite state machine around the parser in order to parse its output, though I haven't taken an in-depth look.
I need a better explanation with clear examples of how to build a parser that can fulfill my needs. If I should take another look at the other two (meaning they'll still be around in a couple version updates), then I'll be happy to do so.
Basically, I'm saving a MU* database off to xml, then reading it back in, as a secondary storage measure. This is to get around the faster, simpler, but less intercompatible shelve module (yay different pickle and DBM formats bleah). It's not vital that I get this worked out right away, since shelve will provide the primary storage method, but I do still want to get this working at some point.
The data structure is a dictionary of dictionaries holding strings, lists, and even more dicts. Yes, complex, but doable. Maybe it'd be easier to just make everything class-based instead and write out all the get-and-set functions, but either way I still have to build and parse the XML documents.
Problem: Expat and xmllib are marked as depreciated in my library docs (for version 2.2.1). Therefore, I'm reluctant to use them.
Other problem: SAX looks like a pile of puzzle blocks to me, rather than a coherent solution. Maybe it's clear to someone who's been using it a while, but from what I see, there are too many options, too many ways of getting it wrong. That just seems terribly unPythonic in my mind. Besides which, the docs _seem_ to imply that I already knew to build a finite state machine around the parser in order to parse its output, though I haven't taken an in-depth look.
I need a better explanation with clear examples of how to build a parser that can fulfill my needs. If I should take another look at the other two (meaning they'll still be around in a couple version updates), then I'll be happy to do so.
