Confusion over etree.ElementTree.Element.getiterator

Stefan Behnel stefan_ml at behnel.de
Sun Jul 4 02:33:17 EDT 2010


Ben Sizer, 04.07.2010 00:32:
> On Jul 3, 11:12 pm, Ben Sizer<kylo... at gmail.com>  wrote:
>
>> >>> for el in root.getiterator():
>>
>> ...        print el
>> [much output snipped]
>> <Element {http://www.w3.org/1999/xhtml}a at d871e8>
>> <Element {http://www.w3.org/1999/xhtml}a at d87288>
>> <Element {http://www.w3.org/1999/xhtml}script at d87300>
>> <Element {http://www.w3.org/1999/xhtml}script at d87378>
>
> Hmm, I think I've worked it out. Apparently the XML namespace forms
> part of the tag name in this case. Is that what is intended?

Sure.


> I didn't see any examples of this in the docs.

Admittedly, it's three clicks away from the library docs on docs.python.org.

http://effbot.org/zone/element.htm#xml-namespaces

Stefan




More information about the Python-list mailing list