How to tell lxml.etree.tostring(element) not to write namespaces in python?

后端 未结 3 374
你的背包
你的背包 2020-12-10 15:16

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 co

3条回答
  •  旧时难觅i
    2020-12-10 15:55

    This is more in comment to the answer by 'unutbu' in which a suggestion to cleanup namespace was desired without giving example. this might be what you are looking for...

    from lxml import objectify
    objectify.deannotate(root, cleanup_namespaces=True)
    

提交回复
热议问题