pyXML (0.8.1): ignoring DTD part...

Gillou nospam at bigfoot.com
Wed Oct 9 09:08:55 EDT 2002


"Martin v. Löwis" <loewis at informatik.hu-berlin.de> a écrit dans le message
de news: j465wd3waq.fsf at informatik.hu-berlin.de...
> "Gillou" <nospam at bigfoot.com> writes:
>
> > I want to carry on parsing even if there's no DTD
> >
> > Any hint ?
>
> If you parse using SAX, set a EntityResolver, and resolve the DTD
> entity to an empty input stream.

Thanks Martin, but I parse using DOM cause I need the complete XML (not some
elements).
It's easier to "objectise" XML with DOM.

As a workaround, I made an "re" based filter that removes the <!DOCTYPE...>
before DOM parsing (dirty but works).

Regards

--Gilles

>
> Regards,
> Martin
>





More information about the Python-list mailing list