How to tell lxml.etree.tostring(element) not to write namespaces in python?
问题 I have a huge xml file (1 Gig). I want to move some of the elements (entrys) to another file with the same header and specifications. Let's say the original file contains this entry with tag <to_move> : <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE some SYSTEM "some.dtd"> <some> ... <to_move date="somedate"> <child>some text</child> ... ... </to_move> ... </some> I use lxml.etree.iterparse to iterate through the file. Works fine. When I find the element with tag <to_move> , let's