Confusion over etree.ElementTree.Element.getiterator

Terry Reedy tjreedy at udel.edu
Mon Jul 5 14:09:37 EDT 2010


On 7/5/2010 6:40 AM, Ben Sizer wrote:

>> Admittedly, it's three clicks away from the library docs on docs.python.org.
>>
>> http://effbot.org/zone/element.htm#xml-namespaces
>
> Hopefully someone will see fit to roll this important documentation
> into docs.python.org before the next release... oops, too late. ;)

Not too late for next release. Open a doc issue with as specific a 
suggestion as possible.
>
> It's one of those things that's easy to fix when you know what the
> problem is. Unfortunately it makes the examples a bit awkward. The
> example on http://docs.python.org/library/xml.etree.elementtree.html
> opens up an xhtml file and reads a "p" tag within a "body" tag, but
> the xhtml specification (http://www.w3.org/TR/xhtml1/#strict) states
> that 'The root element of the document must contain an xmlns
> declaration for the XHTML namespace'. Therefore I don't see how the
> example Python code given could work on a proper xhtml file, given
> that there should always be a namespace in effect but the code doesn't
> allow for it.
>
> That's my excuse anyway! :)


-- 
Terry Jan Reedy




More information about the Python-list mailing list