Can xml.sax NOT process the DTD?

Jim jim.hefferon at gmail.com
Mon Jan 28 07:27:52 EST 2008


On Jan 28, 6:48 am, marek jedlinski <marek... at pobox.INVALID.com>
wrote:
> I've noticed that I can eliminate the error if I create 0-byte dtd files
> and put them where the parser expects to find them, but this is a little
> tedious, since there are plenty of different DTDs expected at different
> locations.
How about overriding the entity resolver in some way like this:

class xResolver(EntityResolver):
    def resolveEntity(self, publicId, systemId):
        return "dummy.dtd"

and then calling .setEntityResolver(xResolver()) ?  That will always
look in the same dtd file, which you say works for you.

Jim



More information about the Python-list mailing list