質問

While validating an XML document using Xerces, it tries to access internet resources in w3c.org. My application that needs to work offline/behind a firewall throws an exception because of that.

Is there a workaround?

ps. This link provides some insights but no workarounds: http://xerces.apache.org/xerces2-j/faq-general.html#faq-10

役に立ちましたか?

解決

The workaround is to supply a "catalog resolver" which redirects these requests to local copies.

A convenient way of doing this, for some applications, is to do the parsing via Saxon, which contains local copies of the most commonly used resources and does the redirection by default, without any user intervention. But whether this is convenient for you depends on the nature of the application.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top