[XML-SIG] [ pyxml-Bugs-609590 ] XmlprocDriver does not call EntityResolv

noreply@sourceforge.net noreply@sourceforge.net
Sun, 15 Sep 2002 08:35:40 -0700


Bugs item #609590, was opened at 2002-09-15 15:35
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=609590&group_id=6473

Category: SAX
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: James Kew (jkew)
Assigned to: Nobody/Anonymous (nobody)
Summary: XmlprocDriver does not call EntityResolv

Initial Comment:
The xmlproc SAX2 parser does not call the 
EntityResolver set with setEntityResolver when 
processing the DOCTYPE declaration:

>>> import xml.sax.sax2exts
>>> import xml.sax.handler
>>>
>>> class MyResolver
(xml.sax.handler.EntityResolver):
... 	def resolveEntity(self, publicId, systemId):
... 	    print "resolving:", systemId
... 	    return systemId
... 	   
>>> parser = 
xml.sax.sax2exts.XMLParserFactory.make_parser()
>>> parser.setEntityResolver(MyResolver())
>>> doc = parser.parse("module_script.xml")
resolving: script.dtd
>>> parser = 
xml.sax.sax2exts.XMLValParserFactory.make_parser
()
>>> parser.setEntityResolver(MyResolver())
>>> doc = parser.parse("module_script.xml")

I want to override the default resolver to search for 
DTDs first in the current directory and then in the 
directory the script is working in -- and I _usually_ 
want to validate as for my input the speed difference 
is not appreciable but developer mistakes are...




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=609590&group_id=6473