<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><style>p {margin:0px;padding:0px;} blockquote { border: 0px; margin-top: 0px; margin-bottom: 0px; }</style></head><body style="">
Hi Stefan,<br><font color="#000000" face="Verdana" size="2"><br><blockquote type="cite"><a href="http://service.gmx.net/fm07/g.fcgi/mail/new?CUSTOMERNO=1130295&t=de1942211941.1202716661.42972b3e&to=jholg%40gmx.de">jholg@gmx.de</a> wrote:<br>> Yep, right. Here's without any objectify-ism:<br>[...]<br>> >>> print etree.__version__<br>> 2.0.alpha4<br><br>Hmmm, I don't get that with 2.0 final and libxml2 2.6.30. Could you double<br>check that on your platform?</blockquote></font><p> </p><p><font color="#000000" face="Verdana" size="2">You're right. I just checked 2.0 final and the current trunk, and I don't see</font></p><p><font color="#000000" face="Verdana" size="2">that problem with neither of them (libxml2 2.6.27):</font></p><p> </p><p>>>> from lxml import etree<br>>>> xml = etree.fromstring(<br>... '<a xmlns:py="http://codespeak.net/lxml/objectify/pytype">'<br>... '<b name="b1"><title py:pytype="str">tit</title><text>foo</text></b>'<br>... '<b name="b2"><text>bar</text></b></a>')<br>>>><br>>>> print etree.tostring(xml, pretty_print=True)<br><a xmlns:py="http://codespeak.net/lxml/objectify/pytype"><br> <b name="b1"><br> <title py:pytype="str">tit</title><br> <text>foo</text><br> </b><br> <b name="b2"><br> <text>bar</text><br> </b><br></a><br> <br>>>><br>>>> foo = xml[0]<br>>>> bar = xml[1]<br>>>> print etree.tostring(xml, pretty_print=True)<br><a xmlns:py="http://codespeak.net/lxml/objectify/pytype"><br> <b name="b1"><br> <title py:pytype="str">tit</title><br> <text>foo</text><br> </b><br> <b name="b2"><br> <text>bar</text><br> </b><br></a><br> <br>>>><br>>>> xml[0] = bar<br>>>> xml.append(foo)<br>>>><br>>>> print etree.tostring(xml, pretty_print=True)<br><a xmlns:py="http://codespeak.net/lxml/objectify/pytype"><br> <b name="b2"><br> <text>bar</text><br> </b><br> <b name="b1"><br> <title py:pytype="str">tit</title><br> <text>foo</text><br> </b><br></a><br> <br>>>> print etree.__version__<br>2.0.0-51192<br>>>> print etree.LIBXML_VERSION<br>(2, 6, 27)<br>>>> print etree.LIBXSLT_VERSION<br>(1, 1, 20)<br>>>> </p><p> </p><p>Holger<br></p><p></p><p></p><div class="signature"><br /><br /><br />-- <br />Psssst! Schon vom neuen GMX MultiMessenger gehört?<br />Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger</div></body></html>