LXML: can't register namespace

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Mar 9 06:41:01 EST 2018


On 2018年3月09日 10:22:23 +0100, Stefan Behnel wrote:
> Andrew Z schrieb am 07.03.2018 um 05:03:
>> Hello,
>> with 3.6 and latest greatest lxml:
>>>> from lxml import etree
>>>> tree = etree.parse('Sample.xml')
>> etree.register_namespace('','http://www.example.com')
>> The default namespace prefix is spelled None (because there is no prefix
> for it) and not the empty string.

Is that documented somewhere?
Is there a good reason not to support "" as the empty prefix?
-- 
Steve


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /