org.openxml.source
Interface XCatalog


public abstract interface XCatalog

Interface into an XCatalog data structure suitable for mapping. XCatalog defines mapping from public identifiers to system identifiers and remapping of system identifiers. This interface defines access to an XCatalog for the purpose of mapping, but does not specify how such catalog should be defined.

The following rules govern mapping:

An XCatalog is assumed to be thread safe for mapping requests, and may be used as a primary catalog, a delegate catalog or an extending catalog at any given time or all at once.

This catalog supports the XCatalog proposal draft 0.2 posted to the xml-dev mailing list by John Cowan. The XCatalog DTD can be found at http://www.ccil.org/~cowan/XML/XCatalog.html.

Version:
$Revision: 1.4 $ $Date: 1999/02/20 02:19:00 $
Author:
Assaf Arkin

Method Summary
 java.lang.String mapPublicId(java.lang.String publicId)
          Called to map a public identifier into a URI.
 java.lang.String mapSource(java.lang.String publicId, java.lang.String systemId)
          Called to map the given source into a URI.
 java.lang.String remapURI(java.lang.String uri)
          Called to remap a system identifier (URI).
 

Method Detail

mapSource

public java.lang.String mapSource(java.lang.String publicId,
                                  java.lang.String systemId)
Called to map the given source into a URI. If a public identifier is specified, the catalog is first searched for a possible mapping for it. If such a mapping is found, the mapped URI is returned. That mapped URI might further be remapped to a different URI. If not public identifier is specified, or the public identifier cannot be mapped, the system identifier is use instead. The system identifier is subject to remapping.
Parameters:
publicId - The public identifier to map, or null
systemId - The system identifier to map, or null
Returns:
The mapped URI, or null

mapPublicId

public java.lang.String mapPublicId(java.lang.String publicId)
Called to map a public identifier into a URI. The catalog is first searched for a possible mapping for the public identifier, then delegates and extending catalogs are searched. That mapped URI might further be remapped to a different URI (see remapURI(java.lang.String)).
Parameters:
publicId - The public identifier to map, or null
Returns:
The mapped URI, or null

remapURI

public java.lang.String remapURI(java.lang.String uri)
Called to remap a system identifier (URI). Searches this catalog and all extended catalogs for a suitable remap entry. If such an entry specifies the exact URI, the mapped-to URI is returned. If no such entry is found, the original URI is returned.
Parameters:
uri - The URI to remap
Returns:
The original or remapped URI