Including Additional Static Xml With Python
I need my current script to include additional xml. This is the script in its current form: import csv import sys from xml.etree import ElementTree from xml.dom import minidom vi
Solution 1:
Why don't you replace
print minidom.parseString(ElementTree.tostring(switch_tag)).toprettyxml()
with
print header + ElementTree.tostring(switch_tag) + footerWhere header and footer are what is above and below the switch tag in your second example output, respectively. Alternatively, if you want to use the prettyxml(), remove the first line from its output.
'\n'.join(minidom.parseString(ElementTree.tostring(switch_tag)).toprettyxml().splitlines()[1:])
Post a Comment for "Including Additional Static Xml With Python"