JEP 268: XML Catalogs
|Component||xml / jaxp|
|Discussion||core dash libs dash dev at openjdk dot java dot net|
|Reviewed by||Brian Goetz, Mandy Chung|
|Endorsed by||Brian Goetz|
Develop a standard XML Catalog API that supports the OASIS XML Catalogs standard, v1.1. The API will define catalog and catalog-resolver abstractions which can be used with the JAXP processors that accept resolvers.
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.
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). A standard API is desirable so that the feature can actually be supported.
The XML Catalog API will define the following interfaces in accordance
with the OASIS XML Catalogs standard, v1.1. It will provide
straightforward support for the core features of the Catalog standard,
CatalogManagerwill manage the creation of XML Catalogs and
CatalogResolvers, as well as features and properties.
Catalogwill 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.
CatalogResolverwill implement JAXP's existing
URIResolverinterfaces. The resolver will supports the OASIS standard processing instruction as a SAX
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), which is what the internal catalog resolver was based on.