You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by xm...@xml.apache.org on 2004/07/09 22:26:26 UTC

[Apache XMLBeans Wiki] New: ExternalEntityResolver

   Date: 2004-07-09T13:26:26
   Editor: 63.120.159.29 <>
   Wiki: Apache XMLBeans Wiki
   Page: ExternalEntityResolver
   URL: http://wiki.apache.org/xmlbeans/ExternalEntityResolver

   XmlBeansExternalEntityResolver

New Page:

##language:en
= 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"
         "http://www.textuality.com/boilerplate/OpenHatch.xml">
       <!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.


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org