How would I convert an XML element into string and a string back to XML format using xml.elementtree in web2py ?
Use parseString to get xml element from string and toxml to make string out of xml element. Something like this.
from xml.dom.minidom import parseString
dom = minidom.parseString(content)
...
# do some changes to dom here
return dom.toxml()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With