[lxml-dev] Problem with using the same URI twice in a namespace

Andreas Degert ad at papyrus-gmbh.de
Tue Apr 22 23:01:17 CEST 2008


I assume it is legal to have to following namespace declaration/usage:

<top xmlns="a" xmlns:a="a" xmlns:b="b">
  <foo bar=""/>
  <b:foobar a:bar=""/>
</top>

It works when I read such a definition with lxml.etree.parse, but I
can't construct it with lxml.etree.Element because then the nsmap dict
will be normalized in such a way that each URI occurs only once.

Is this a bug in lxml or shouldn't it be used in this way?

cheers
Andreas


More information about the lxml-dev mailing list