1
import xml.etree.ElementTree as badET
2
import defusedxml.ElementTree as goodET
4
xmlString = "<note>\n<to>Tove</to>\n<from>Jani</from>\n<heading>Reminder</heading>\n<body>Don't forget me this weekend!</body>\n</note>"
7
tree = badET.fromstring(xmlString)
9
badET.parse('filethatdoesntexist.xml')
10
badET.iterparse('filethatdoesntexist.xml')
14
tree = goodET.fromstring(xmlString)
16
goodET.parse('filethatdoesntexist.xml')
17
goodET.iterparse('filethatdoesntexist.xml')
18
a = goodET.XMLParser()