Confusion over etree.ElementTree.Element.getiterator

Ben Sizer kylotan at gmail.com
Sat Jul 3 18:32:33 EDT 2010


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? I didn't
see any examples of this in the docs.

--
Ben Sizer



More information about the Python-list mailing list