The way you would do this depends on the parser you are using. There is no standard way to use a parser feature like caching grammars.
For Xerces, see http://xerces.apache.org/xerces2-j/faq-grammars.html#faq-1 -----Original Message----- From: Ben Munat [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 9:14 PM To: dom4j-user@lists.sourceforge.net Subject: [dom4j-user] avoid remote fetching of dtds Does anyone know how to get the underlying parser to *not* go and retrieve a DTD on each parse? And in this case I can't download the DTD and change the PUBLIC to SYSTEM (it's an html page that we pull data out of, but will also be read by humans in various places). I found a DTDHandler interface in the org.sax stuff and tried whipping up my own XMLReader implementation (extending ParserAdapter), which just sets the DTDHandler to my own implementation (extending DefaultHandler), which in turn just overrides the method "notationDecl" to make it a no-op. But, that didn't work... went and looked at the DefaultHandler code and it's a no-op anyway. Hmm, and actually, I'm going to want my code that parses this have access to the DTD, since it will need it to resolve entitities (validation's nice too, but not absolutely necessary). So, in reality my question is, how can I convince some parser to ignore the PUBLIC declaration in the DTD and use the cached local copy instead? thanks, b ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user