[XML-SIG] turning off dtd resolver in sax

Paul Tremblay phthenry at earthlink.net
Thu Oct 23 02:03:01 EDT 2003


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.

Here is a snippet of my code:


	parser = xml.sax.make_parser()
        parser.setFeature(feature_namespaces, 0)
        parser.setErrorHandler(ErrorHandler())
        section_handler = FormSections( 
            write_obj = write_obj,
            highest_level = self.__highest_level,
            )
        
	parser.setContentHandler(section_handler)
	parser.parse(self.__input_file)

thanks

Paul

        


-- 

************************
*Paul Tremblay         *
*phthenry at earthlink.net*
************************



More information about the XML-SIG mailing list