[XML-SIG] turning off dtd resolver in sax

Radovan Chytracek Radovan.Chytracek at cern.ch
Thu Oct 23 08:17:05 EDT 2003


Hi,

  I was having the same problem and tried to discuss it here without any
feedback, for details see:

http://mail.python.org/pipermail/xml-sig/2003-September/009876.html


where I have provided a solution to this. However, it does not work as
is because PyXML has for some reasons disabled EntityResolver proper
call sequence. I had to hack my local Python installation to make it
work. Hope this helps you a bit.

Radovan

> -----Original Message-----
> From: Paul Tremblay [mailto:phthenry at earthlink.net] 
> Sent: Thursday, October 23, 2003 8:03 AM
> To: xml-sig at python.org
> Subject: [XML-SIG] turning off dtd resolver in sax
> 
> 
> 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*
> ************************
> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG at python.org 
> http://mail.python.org/mailman/listinfo/xml-sig
> 



More information about the XML-SIG mailing list