JDK-8023732 : JEP 268: XML Catalogs
  • Type: JEP
  • Component: xml
  • Sub-Component: jaxp
  • Priority: P2
  • Status: Closed
  • Resolution: Delivered
  • Fix Versions: 9
  • Submitted: 2013-08-26
  • Updated: 2019-04-08
  • Resolved: 2017-05-22
Related Reports
Blocks :  
Blocks :  
Relates :  
Relates :  
Description
Summary
-------

Develop a standard XML Catalog API that supports the
[OASIS XML Catalogs standard, v1.1][catalog1.1].
The API will define catalog and catalog-resolver abstractions which can
be used with the JAXP processors that accept resolvers.

[catalog1.1]: https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html


Non-Goals
---------

It is not intended that the new API replicate the existing internal
catalog implementation. In other words, there is no intent to provide
compatible APIs or maintain source or binary compatibility.  Existing
libraries or applications that use the internal API will need to migrate
to the new API in order to take advantage of the new features.


Motivation
----------

XML Catalogs are useful when resolving external references in
XML/XSD/XSL, removing the need to repetitively retrieve external
resources. In some cases, an XML Catalog is required to ensure that
applications work properly in local environments where the source of the
imported XML resource is different from the original.

XML Catalogs can also improve application security by directing remote
external references to a local Catalog and then forbidding the retrieval
of external resources.

An internal catalog resolver has been included in the JDK since JDK 6.
Due to the lack of a public API, it has been used or referenced directly
by external libraries/applications. It was also bundled and delivered in
a Maven repository and used by applications such as JAX-WS/JAXB (see,
e.g., [com.sun.xml.ws.util.xml.XmlUtil][jaxws_XmlUtil]). A standard API
is desirable so that the feature can actually be supported.

[jaxws_XmlUtil]: https://svn.java.net/svn/jax-ws~sources/branches/jaxws22/jaxws-ri/rt/src/main/java/com/sun/xml/ws/util/xml/XmlUtil.java


Description
-----------

The XML Catalog API will define the following interfaces in accordance
with the [OASIS XML Catalogs standard, v1.1][catalog1.1]. It will provide
straightforward support for the core features of the Catalog standard,
implementing the `EntityResolver` and `URIResolver` interfaces:

  - The `CatalogManager` will manage the creation of XML Catalogs and
    `CatalogResolver`s, as well as features and properties.

  - A `Catalog` will implement the semantics of OASIS Open Catalog
    files. It will define an entity catalog that maps external
    identifiers and URI references to (other) URI references, and
    delegates to other catalogs.

  - A `CatalogResolver` will implement JAXP's existing `EntityResolver`
   and `URIResolver` interfaces. The resolver will supports the OASIS
   standard processing instruction as a SAX `XMLFilter`.

This JEP also proposes to remove the internal catalog resolver
implementation after the public API is delivered.

The new API will conform to the current specification version 1.1, which
is compatible with
[OASIS Technical Resolution 9401:1997 (Amendment 2 to TR 9401)][TR9401],
which is what the internal catalog resolver was based on.

[TR9401]: http://www.oasis-open.org/html/a401.htm