XML to dictionary?

Paul Prescod paul at prescod.net
Fri Jan 7 13:35:43 EST 2000


> From: "John Jensen" <johnjensen at my-deja.com>
> I'm thinking that the best thing to do in this situation is just write a
> quick customized script, and not worry about using "fancy" libraries like
> xmllib, pyxie, etc.

I don't see what is "fancy" about xmllib and I can't imagine that
writing your own parser (is that what you mean by "quick customized
script") would be easier than using one that already exists.

For your task I think that you just have to override a couple of
methods. Writing a parser will be more work and it will be more fragile.

> From: "Darrell" <darrell at dorb.com>
> Here's my own hack at tag parsing http://www.dorb.com/darrell/xmlP/
> With wxPython it gives you a tree view of your tags. Replace the branches
> with dictionaries and away you go.
> 
> --Darrell

I'm a little surprised to see this comment in your code:

"""Convert this function to 'C' for real speed."""

Too masochistic to write it yourself only once?? :)

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
When I'm gone, boxing will be nothing again.  The fans with the cigars
and the hats turned down'll be there, but no more housewives and
little men in the street and foreign presidents.  .... I was the
onliest boxer in history people asked questions like a senator.  
            -- Muhammad Ali






More information about the Python-list mailing list