[XML-SIG] Re: turning off dtd resolver in sax

Andrew Shearer ashearer at shearersoftware.com
Thu Oct 23 22:02:42 EDT 2003

Apologies to the list for posting the same answer twice in a week, but 
hopefully this will be helpful:

> I had a similar problem with the first cut of a parser for Apple's 
> PList format. It worked fine when I was connected to the Internet, but 
> failed when I wasn't. The documents specified an Internet-based DTD 
> when they really could stand alone, so I used code similar to the 
> following:
> parser = xml.sax.make_parser()
> parser.setFeature(xml.sax.feature_external_ges, 0)
> parser.setFeature(xml.sax.feature_external_pes, 0)
> The complete code is at

>  <http://www.shearersoftware.com/software/developers/plist/>.

On Thursday, October 23, 2003, at 12:10  PM, Paul Tremblay 
<phthenry at earthlink.net> wrote:

> Is there a way to run SAX if the dtd in the document points to a url,
> and the url cannot be retrieved? I can parse my documents with SAX so
> long as I am connected to the internet. But when I am not connected, I
> get an error that the url cannot be found.
> I could just delete the dtd, but this is kind of a hack. I am
> distributing code, and I would like for the XML document which I am
> parsing to have a dtd.

Andrew Shearer

More information about the XML-SIG mailing list