Using an XML Catalog with a Java library that uses JAXP internally
Posted
by Brian Ferris
on Stack Overflow
See other posts from Stack Overflow
or by Brian Ferris
Published on 2010-06-18T07:00:06Z
Indexed on
2010/06/18
7:03 UTC
Read the original article
Hit count: 397
I'm using the Apache web service xml rpc library to make requests to an rpc service. Somewhere in that process is a xml document with a DTD reference to http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd, which the library attempts to download when parsing the XML. That download fails with a 503 status code because the w3c is blocking repeated downloads of this largely static document from Java clients.
The solution is XML Catalogs to locally cache the DTD. However, while I can find examples of setting an EntityHandler on a JAXP SAXParser instance directly to enable catalog parser support, I don't actually have access to the underlying parser here. It's just being used by the xml rpc library. Is there any way I can set a global property or something that will tell JAXP to use XML catalogs?
© Stack Overflow or respective owner