Bit of a beginner question here:
Say I have a block of xml:
<root>
<district>
<house><room><door/><room></house>
</district>
<district>
<street>
<house>and so on</house>
</street>
etc.
With ElementTree I can do:
houses=doc.findall(".//house")
to select all the house nodes, regardless of their parent. What I want to do now is turn each of the house nodes into a separate tree object.
Part of the reason for doing this is that I then want to do another find:
door=houseXml.findall(".//door")
I can do something like:
for _house in houses:
houseXml=_house.getiterator
but this doesn't seem to do what I want.
Where am I going wrong?