[lxml-dev] Processing instruction roundtrip (again)

Christian Zagrodnick cz at gocept.com
Thu Dec 6 08:59:51 CET 2007


Hi,

i've got a problem with Processing Instructions (2.0alpha5, Python2.4):


>>> obj = lxml.objectify.XML('<a/><?foo:bar blurb ?>')
>>> lxml.etree.tostring(obj)
'<a/>'
>>> obj = lxml.objectify.XML('<a><?foo:bar blurb ?></a>')
>>> lxml.etree.tostring(obj)
'<a><?foo:bar blurb ?></a>'
>>>

So a PI not contained in the root node gets lost. Any way to fix this?


-- 
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891





More information about the lxml-dev mailing list