[Baypiggies] XSLT vs Python for XML manipulation (Venkatraman S)
raminf at gmail.com
Thu May 29 19:08:51 CEST 2008
> On a related note, am trying to code a generic class(xml parser) which
> defines its own member variables at run time. That is, if the xml is :
> and after i parse it, i should be able to access individual entities
> with a
> DOT notation, i.e, a.b returns me 10 and a.d returns me a list of
> Am just clueless - any pointers?
You can try using Amara (http://uche.ogbuji.net/tech/4suite/amara/).
It supports dot notation to access sub-elements as well as array
notation to index into children. To get the sub-element text as list,
you'll have to write a small bit of custom code that traverses the
children and returns their bodies as a list. Feel free to post back
here if you have trouble with it.
More information about the Baypiggies