XMLBeans External Entity Resolver

This page is a mini spec on how to resolve external entities.

Support for using a class that implements org.xml.sax.EntityResolver interface in two places:

How to set the resolver

  1. Use XmlOptions.setEntityResolver(EntityResolver resolver) to pass in the resolver to be used for parsing XML documents {{ XmlObject.parse(...) }} or compiling XMLSchema or WSDL documents {{ SchemaTypeSystemCompiler.compile(...) }}

2. If no entity resolver has been set in XmlOptions, org.apache.xml.resolver.tools.CatalogResolver will be used as a resolver if Apache's XmlCommons resolver.jar is on the classpath and a catalog file has been specified.

      scomp -catalog catalog_file.cat

3. If the previous conditions failed, the xmlbean.entityResolver system property will specify the name of a global, read only resolver.

4. If all previous attempts failed, the resolver will be at the discretion of the used XML parser for XML documents and for XMLSchema and WSDL documents a simple resolver implementation will be used if
{{ XmlOptions.setCompileDownloadUrls() }}
or
{{ scomp -dl ... }}
is used.