Simple XML-to-Python conversion

Swaroop C H swaroopch at gmail.com
Fri Mar 18 23:45:35 EST 2005


On 18 Mar 2005 20:24:56 -0800, gaudetteje at gmail.com
<gaudetteje at gmail.com> wrote:
> >From what I understand, this is how XML was standardized, in a sort of
> hierarchical structure of infinite possibilities.  The problem I'm
> having with these structures is that I need to actively search through
> each level for the item I want.  All I really want to do is access one
> or more elements at the same time and know where they are without
> searching.
> 
> What I'm looking to use are basic structures such as:
> root.path
> root.input.method
> root.input.filename
> root.output.filename

You should be using XPath (4suite has it) to get the parts that you want.
A really quick intro is at
http://simon.incutio.com/archive/2003/10/21/xpathRocks

Regards,
-- 
Swaroop C H
Blog: http://www.swaroopch.info
Book: http://www.byteofpython.info



More information about the Python-list mailing list