Remove whitespaces and line breaks in a XML file

David Vicente dvicente at
Mon Feb 7 18:45:31 CET 2011



I´m parsing an xml file with xml.etree. It works correctly, but I have a
problem with the text attribute of the elements which should be empty. For
example, in this case:





The text element of “book” should be empty, but it returns me some
whitespaces and break lines. I can´t get remove these whitespaces without
remove information. 


Some idea?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list