我有一个像这样的xml:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:epp xmlns:ns0="urn:ietf:params:xml:ns:epp-1.0"
xmlns:ns1="http://epp.nic.ir/ns/contact-1.0">
<ns0:command>
<ns0:check>
<ns1:check>
<ns1:id>ex61-irnic</ns1:id>
<ns1:id>ex999-irnic</ns1:id>
<ns1:authInfo>
<ns1:pw>1487441516170712</ns1:pw>
</ns1:authInfo>
</ns1:check>
</ns0:check>
<ns0:clTRID>TEST-12345</ns0:clTRID>
</ns0:command>
</ns0:epp>
我希望用Python 3将它改成这样:
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<check>
<check>
<id>ex61-irnic</id>
<id>ex999-irnic</id>
<authInfo>
<pw>1487441516170712</pw>
</authInfo>
</check>
</check>
<clTRID>TEST-12345</clTRID>
</command>
</epp>
我尝试使用lxml模块中的objectify.deannotate来删除ns,但它没有起作用。你能帮我实现我的目标吗?