xml application advice

Diez B. Roggisch deets at nospam.web.de
Wed Jun 10 13:35:24 EDT 2009

> If what you're interested in is to get real work done, why decide to
> make XML a showstopper?
> I see two tasks: (a) transforming a text file description of a sprinkler
> system into a Python data structure, and (b) implementing algorithms
> to find out important stuff about such a data structure.
> You do not need (a) before you can do (b). You can even have Python as
> your input format, and eval() the file. Crude and insecure, but it
> works, at almost zero cost.

While I certainly agree that XML often means more trouble than it's worth, I
don't concur in this concrete case. If the OP has a tree-structure, XPath
is a *very* powerful way to operate on that - and as he seems to have
questions like "get the one node with the attribute X, then the first one
above that having more than one child of kind Y", it can get in handy.


More information about the Python-list mailing list