pyXML (0.8.1): ignoring DTD part...
Martin v. Löwis
loewis at informatik.hu-berlin.de
Wed Oct 9 09:08:27 EDT 2002
"Gillou" <nospam at bigfoot.com> writes:
> > 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).
I see. You still could create a SAX parser that you modify with an
EntityResolver, and pass that to xml.dom.minidom.parse.
Regards,
Martin
More information about the Python-list
mailing list