[FRPythoneers] looking for help with elementtree

Sean Gillies sgillies at frii.com
Fri Jun 27 14:51:02 MDT 2003


Just subscribed today and am looking forward to contributing to
the discussions.  First, I have a question.

I am having fun using ElementTree in a project but have
run into a problem.  Maybe one of you has run across and
solved it?

After reading in an element tree from XML, I get
an element from the tree like this:

    properties = tree.find('PROPERTIES')

If I wrap properties in an ElementTree and write, the XML
output is:

<PROPERTIES><ENVELOPE minx="-106" maxx="-105" miny="40" maxy="41"/>

If I execute code like this:

     for child in properties:
         print child.tag

Then it does print out


evidently there is an ENVELOPE element?

however, I am not able to find the ENVELOPE element under


returns None.

How can find() return None when I am finding an element tagged 
when iterating over properties?


Sean Gillies
sgillies at frii dot com

More information about the FRPythoneers mailing list