Project

Profile

Help

Turning off DTD request, or caching DTDs?

Added by Anonymous over 17 years ago

Legacy ID: #4191314 Legacy Poster: Jaran Nilsen (sfkarbo)

Hi. I am using Saxon to transform a large number of webpages, several thousands every day. I have discovered that w3.org is not so happy with me, and the reason for this is that whenever I transform a document with Saxon, 4 requests for resources at w3.org is being made! No wonder w3.org has not been liking me a whole lot for the last couple of days. I was wondering if anyone could help me understand how I can turn of the request for resources at w3.org. The resources are: /TR/xhtml1/DTD/xhtml1-transitional.dtd /TR/xhtml1/DTD/xhtml-lat1.ent /TR/xhtml1/DTD/xhtml-symbol.ent /TR/xhtml1/DTD/xhtml-special.ent What I would love, was to tell Saxon to tell it's underlying XML parser to cache these resources, or simply ignore them. I have set the validation parameter in the XQuery configuration to false, but that does not have any effect: Configuration config = new Configuration(); config.setValidation(false); I am guessing this is an Xerces issue, but I wanted to post here in case any of you Saxon gurus know how this can easily be done. Thanks a lot in advance. Regards, Jaran


Replies (2)

RE: Turning off DTD request, or caching DTDs? - Added by Anonymous over 17 years ago

Legacy ID: #4191372 Legacy Poster: Michael Kay (mhkay)

I would normally expect these DTD resources to be cached by an HTTP proxy server, so that requests for them would not actually reach W3C. If you can't arrange for that to happen, you can configure Xerces with an EntityResolver that causes it to use a local copy of these files in local filestore. DTDs are generally fetched whether or not you request validation, because they are also needed for other purposes such as expanding entity references: three of your DTD files are concerned solely with entity expansion, and not with validation. Michael Kay

RE: Turning off DTD request, or caching DTDs? - Added by Anonymous over 17 years ago

Legacy ID: #4191643 Legacy Poster: Jaran Nilsen (sfkarbo)

I solved the issue by creating my own XMLReader, where I set the feature "http://apache.org/xml/features/nonvalidating/load-external-dtd" to false. That did the trick for me. Thanks for your reply :) Jaran

    (1-2/2)

    Please register to reply