[lxml-dev] Simple doctypes not in docinfo.doctype
Stefan Behnel
stefan_ml at behnel.de
Sat Oct 25 20:16:55 CEST 2008
Hi,
Stefan Behnel wrote:
> F Wolff wrote:
>> I've tried this with an old (1.3.2) and newer (2.0.6) lxml version.
>>
>> (this example is roughly based on the code at
>> http://codespeak.net/lxml/tutorial.html)
>>
>> from lxml import etree
>> from StringIO import StringIO
>> tree = etree.parse(StringIO("""<!DOCTYPE TS><TS></TS>"""))
>> tree.docinfo.doctype
>> ''
>>
>> From my understanding this DOCTYPE declaration is valid (and occurring
>> in the wild in Qt .ts files). My real issue is round-trip problems in a
>> reading-writing cycle where the DOCTYPE is lost, but I guess not being
>> able to use .docinfo.doctype is already a problem.
>
> I agree that better handling is desirable here. Could you file a bug report so
> that this doesn't get lost?
Ok, I fixed it anyway. Here's a patch.
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serialise-internal-subset.patch
Type: text/x-patch
Size: 1333 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20081025/f621897e/attachment-0001.bin
More information about the lxml-dev
mailing list