Suds generates empty elements; how to remove them?

前端 未结 7 1522
傲寒
傲寒 2020-12-31 07:51

[Major Edit based on experience since 1st post two days ago.]

I am building a Python SOAP/XML script using Suds, but am struggling to get the code to generate SOAP/X

相关标签:
7条回答
  • 2020-12-31 08:54

    You can filter the empty elements out with a regular expression.

    Assuming your XML data is in the string xmltext;

    import re
    filteredtext = re.sub('\s+<.*?/>', '', xmltext)
    
    0 讨论(0)
提交回复
热议问题