[Zope] Natural XML Parsing

Jeff Griffith Jeff Griffith" <jgriffith@hbs.edu
Tue, 13 Mar 2001 18:46:42 -0500


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')
---------------
a more complete write-up w/source is available at
http://www.people.hbs.edu/jgriffith/simplexmlobject.html

Thanks!
-Jeff Griffith