dharana wrote:
Hello list. I've found something really weird with lxml, I hope you can help me. I want dump() output but I can't get it and tostring returns the full xml document, not the part I need.
import lxml.etree mydoc = lxml.etree.fromstring('<?xml version="1.0"?><req><oml><section><list><items><item>quick</item></items></list></section></oml></req>')
lxml.etree.tostring(oml) '<req><oml><section><list><items><item>quick</item></items></list></section></oml></req>'
lxml.etree.dump(oml) <oml><section><list><items><item>quick</item></items></list></section></oml>
oml <Element oml at -481b6608>
lxml version 0.6
There are some issues with 'tostring()' in lxml 0.6. I've solved some of them in the svn version that will turn into 0.7, but I still need to resolve one more issue. Anyway, am aware of these issues, will resolve them. Thanks for the report and sorry you had to run into this! Regards, Martijn