[Expat-discuss] & symbol workaround
Karl Waclawek
karl at waclawek.net
Wed Feb 4 22:09:15 CET 2009
Brad Causey wrote:
> Nick,
>
> I completely agree. Unfortunately, I don't have control over the code that
> generates these XML files.
> If there isn't a better alternative, I'll have to create a duplicate of
> EVERY file and parse each one at a text level to replace non-standard
> characters with a escaped version. (doing this for < is nearly impossible)
> This is something I am trying to avoid for obvious reasons. I don't like
> non-standard XML any more than the next guy. (I've been through 3 different
> python XML parsers trying to resolve this) But I'm running out of options.
> Any ideas?
>
>
There is no XML parser that will accept these files, as they are not
well-formed.
Strictly speaking, they are not XML files at all.
You could try to fix each block as you are passing them to the Expat parser.
Not sure how the Python wrapper works, though.
Karl
More information about the Expat-discuss
mailing list