I also saw this http://www.intertwingly.net/blog/1438.html in the
Daily Python-URL that looks interesting (haven't followed up)
However, the following comment doesn't necessarily recommend to use
it:
Hmm... XML Objectify (which I contributed to), available by David
Mertz here: http://gnosis.cx/download/Gnosis_Utils-current.tar.gz
does the same thing as xmltramp, it can work off expat (scaling much
better) and allows you to override class/tag behavior in Python.
Xmltramp is a nice hack (and much prettier than Objectify, source-code
wise), but XO is way more powerful.
Posted by Costas Malamas at 17:09
--b
On Thu, 05 Jun 2003 15:49:56 -0400
"A.M. Kuchling" wrote:
> I'm confronted with the task of writing some code that will parse some
> XML and create
> a bunch of Python objects. e.g.:
>
>
> WackyName
> 45
> ...
>
>
> There are 35 classes, all with different sets of attributes, so I'd like
> to parse all these files without writing reams of parsing code for each
> class. I'm thinking of using dulcinea.specified to define all the
> expected attributes -- each class would subclass Specified -- and then
> use that information to convert strings to integers (or whatever) as
> needed. The only missing piece would be a convert_value(text, spec)
> which took the string 'text' and converted it to whatever Python type
> defined by 'spec'. Considering that it probably won't have to handle
> sequence types, convert_value() shouldn't be too difficult to write.
>
> Does this approach seem reasonable? Is there anything in
> dulcinea.specified that would make it a bad idea? Performance might be
> one reason, but 'specified' seems to stay nicely out of the way
> until you actually want to check an object against the specification.
>
> Hmm... while Googling this, I just turned up
> http://gnosis.cx/publish/programming/xml_matters_20.txt, which describes
> an approach that resembles
> dulcinea.specified quite a bit. Maybe this idea isn't as insane as I
> thought.
>
> --amk
>
>
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://mail.mems-exchange.org/mailman/listinfo/quixote-users
>
/-----------------------------------------------------------------
| Bud P. Bruegger, Ph.D.
| Sistema (www.sistema.it)
| Via U. Bassi, 54
| 58100 Grosseto, Italy
| +39-0564-411682 (voice and fax)
\-----------------------------------------------------------------