cmalmqui wrote:
> tree = etree.parse('10_07_2009 16_48_00_history.tcx')
> root = tree.getroot()
> 
> elem = root[0][0]
> 
> # iterate over all laps
> for i in range(1, len(elem)-1):

Note that you can iterate over elements as in

        for lap_element in elem:
            # ...

Then use

        record = lap.find("recordtagname")

to find things inside the subtree. You can also use XPath-like expressions
such as

        all_intersting_elements =
                lap.findall("sometag/somechild//somedescendant")

Stefan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to