[lxml-dev] space in attribute name: xpath expression?
TP
paratribulations at free.fr
Tue Mar 17 11:55:16 CET 2009
jholg at gmx.de wrote:
>>>> foo_elem[0].set( "tu tu", "22" )
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "lxml.etree.pyx", line 646, in lxml.etree._Element.set
> (src/lxml/lxml.etree.c:9638)
> File "apihelpers.pxi", line 411, in lxml.etree._setAttributeValue
> (src/lxml/lxml.etree.c:31508) File "apihelpers.pxi", line 1323, in
> lxml.etree._attributeValidOrRaise (src/lxml/lxml.etree.c:38843)
> ValueError: Invalid attribute name u'tu tu'
>
>>>> print ET.__version__
> 2.1.5
On my computer:
>>> print ET.__version__
1.3.6
(I use Kubuntu 8.04)
So the bug seems to have disappeared in the newer versions.
> Yes, why not use a valid separator like _ or . and split words accordingly
> for representation. Of course, you'd have to make sure that your separator
> does not normally show up in your expressions.
Thanks for your opinion on the subject.
Julien
--
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
9&1+,\'Z4(55l4('])"
"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)
More information about the lxml-dev
mailing list