Great, thanks!<br><br><div class="gmail_quote">2008/10/25 Stefan Behnel <span dir="ltr">&lt;<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<div><div></div><div class="Wj3C7c"><br>
Alex Klizhentas wrote:<br>
&gt; Hi All, I&#39;ve read that<br>
&gt; &quot;<br>
&gt; Serialising an ElementTree now includes any internal DTD subsets that are<br>
&gt; part of the document, as well as comments and PIs that are siblings of the<br>
&gt; root node.<br>
&gt; &quot; (from changelog)<br>
&gt;<br>
&gt; but I&#39;ve failed to achieve this goal, dtd data is lost:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; root = lxml.etree.parse(StringIO(&quot;&quot;&quot;&lt;?xml version=&quot;1.0&quot;<br>
&gt; encoding=&quot;utf-8&quot;?&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!DOCTYPE schema [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!ATTLIST reference id ID #REQUIRED&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!ATTLIST joined_values id ID #REQUIRED&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!ATTLIST file id ID #REQUIRED&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!ATTLIST lookup id ID #REQUIRED&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!ATTLIST selector id ID #REQUIRED&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!ATTLIST Column id ID #REQUIRED&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;schema/&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;))<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; print lxml.etree.tostring(root)<br>
&gt;<br>
&gt; prints me<br>
&gt;<br>
&gt; &lt;schema/&gt;<br>
<br>
</div></div>Time machine strikes again, I just fixed this fifteen minutes ago and was just<br>
in the middle of testing it. :)<br>
<br>
Here&#39;s a patch.<br>
<font color="#888888"><br>
Stefan<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Alex<br>