LXML: can't register namespace

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Mar 7 00:35:17 EST 2018


On Tue, 06 Mar 2018 23:03:15 -0500, Andrew Z wrote:

> Hello,
>  with 3.6 and latest greatest lxml:
> 
> from lxml import etree
> 
> tree = etree.parse('Sample.xml')
> etree.register_namespace('','http://www.example.com')

> it seems to not be happy with the empty tag . But i'm not sure why and
> how to go about it.

Have you tried using something other than the empty string?

In the interactive interpreter, what does 

help(etree.register_namespace) 

say?



-- 
Steve




More information about the Python-list mailing list