plomino/Plomino — pull request #135 by jean (2012-07-28 07:32:34+00:00)
Title: Deal with illegal chars in XML

Deal with tracebacks like this:

Traceback (most recent call last):
File "", line 1, in ?
File "/usr/local/lib/python2.4/xml/dom/minidom.py", line 1925, in parseString
return expatbuilder.parseString(string)
File "/usr/local/lib/python2.4/xml/dom/expatbuilder.py", line 940, in parseString
return builder.parseString(string)
File "/usr/local/lib/python2.4/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 94, column 24

The patch deals with the case when we generate XML from documents in Plomino.
If we import documents, we assume that they should be fixed before import.

If acceptable, the patch could be improved to log when illegal characters are being replaced.