[lxml-dev] Problem with ":" char in tag names

Martijn Faassen faassen at startifact.com
Fri Aug 17 14:50:37 CEST 2007


Dave Kuhlman wrote:
> I've been using lxml and think it is great, but ...
> 
> I recently installed lxml-1.3.3.  Now I find that the following
> gives me an error:
> 
>     In [3]: from lxml import etree
>     In [4]: etree.Element('abc:def')
>     ------------------------------------------------------------
>     Traceback (most recent call last):
>       File "<ipython console>", line 1, in <module>
>       File "etree.pyx", line 1801, in etree.Element
>       File "apihelpers.pxi", line 101, in etree._makeElement
>       File "apihelpers.pxi", line 723, in etree._getNsTag
>     ValueError: Invalid tag name
> 
> It's because of the ":" in the tag name.

As another data point: by coincidence yesterday I saw a discussion of 
some other project who also ran into this problem.

http://groups.google.com/group/html5lib-discuss/browse_thread/thread/9997a2468ab2b362

No idea about the context there.

Regards,

Martijn



More information about the lxml-dev mailing list