Limited XML tidy

Magnus Lie Hetland mlh at selje.idi.ntnu.no
Thu Aug 25 09:29:52 EDT 2005


In article <t8vwtmcy54t.fsf at parabrisas.esc.cam.ac.uk>, Toby White wrote:
>
[snip]

I do similar stuff in the new (upcoming) version of Atox
(atox.sf.net), which works with potentially ill-formed, partial XML
(in the form of PYX events) internally, and can take partial,
ill-formed XML as input.

>The problem is that when the sax handler raises an exception,
>I can't see how to find out why. What I want to do is for
>DodgyErrorHandler to do something different depending on 
>where we are in the course of parsing. Is there anyway
>to get that information back from xml.sax (or indeed from
>any other sax handler?)

What I ended up doing was using an SGML parser (sgmlop) instead. It's
highly forgiving (even of illegal entities and the like) but gives me
the information I need. Might be worth a look in your app too?

>Toby

-- 
Magnus Lie Hetland
http://hetland.org



More information about the Python-list mailing list