Differences between revisions 34 and 35
Revision 34 as of 2011-12-07 01:14:49
Size: 2213
Editor: static-58-108-220-236
Revision 35 as of 2011-12-19 22:14:32
Size: 1923
Editor: c-98-195-211-55
Comment: remove sp@m
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Line 27: Line 27:
[[http://www.ezistreet.com/category/business-services/|business services]]
Line 33: Line 33:
[[http://bookkeeperinmelbourne.wordpress.com/|bookkeeper Melbourne]]
Line 40: Line 40:
is used.  is used.

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: - when parsing regular XML documents that contain references to external entities

  • Ex:
    •        <!ENTITY open-hatch
               SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
             <!ENTITY open-hatch
               PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"
             <!ENTITY hatch-pic
               SYSTEM "../grafix/OpenHatch.gif"
               NDATA gif >

- when parsing XMLSchema documents or WSDL documents that contain imports or includes

  • Ex:
    •        <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema"
               ... >
               <xs:include schemaLocation="included.xsd"/>

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.

ExternalEntityResolver (last edited 2011-12-19 22:14:32 by c-98-195-211-55)