pyXML (0.8.1): ignoring DTD part...

Gillou nospam at bigfoot.com
Tue Oct 8 15:24:55 CEST 2002


Hi,

I'm looking for a way to ignore the DTD of an XML. In example

==SNIP==
data = """<?xml version="1.0"?>
<!DOCTYPE stuff SYSTEM "nowhere.dtd">
<stuf>
...
</stuff>"""
from xml.dom.ext.reader.Sax2 import Reader
xr = Reader()
# Error raised below cause there's no "nowhere.dtd"
xr.fromString(data)
==/SNIP==

I want to carry on parsing even if there's no DTD

Any hint ?

Thanks by advance

--Gilles






More information about the Python-list mailing list