On Wed, 14 Mar 2001 10:46, Jeff Griffith wrote:
Hey All,
While messing around with XML I became really frustrated at how unnatural it seemed to extract data out of documents. I ended up writing my own python class to do exactly what felt natural. The problem is the entire time I kept telling myself "this code has to already exist somewhere" I just could never find it.
So if anyone is interested take a look at how this class works and tell me if 1) this seems useful 2) this is already supported by someone else
A brief example of how it is used --------------
< collection > < comic issue="1"> < author > Stan Lee < /author > < /comic > < /collection >
can be accessed as
collection.comic.author.TEXT collection.comic.ATTR('issue')
Nice idea, however what happens when you have multiple 'comic' tags at that point?
--------------- a more complete write-up w/source is available at http://www.people.hbs.edu/jgriffith/simplexmlobject.html
Perhaps you've addressed this shortcoming in your write up.. unfortunately, i don't have time to read it.. :(
Thanks! -Jeff Griffith
Have a better one, Curtis Maloney.