ParseError Invalid Character with cElementTree

webfan

New Member
I'm trying to iteratively parse a tree with a checksum at the end, using:\[code\]import xml.etree.cElementTree as etfor event, elem in et.iterparse("C:\myXMLfile.xml"): if elem.tag == "Signature": elem.clear()\[/code\]This raises a \[code\]ParseError: reference to invalid character number: line 4205, column 25\[/code\] at this character: \[code\]<Signature value="http://stackoverflow.com/questions/10939452/e?'O;????5?u??c???]????<??jX" />\[/code\]I thought the \[code\]elem.clear()\[/code\] statement would be a way around that, but it seems like it processes the attribute before clearing. Is there a way I can clear this element without processing it first?
 
Back
Top