Interface XMLCatalogResolver
- All Known Implementing Classes:
CatalogManager
,ResourceCache
The XMLCatalogResolver
interface exposes the catalog-based lookup
functionality of the OASIS Open XML Catalogs 1.1 specification. It supports
all of the normative catalog entries and several of the TR9401 entries
described in Appendix D.
The API doesn't expose methods to access catalog
, group
, or
nextCatalog
entries because they are internal to the resolution
process. A conformant catalog processor must support them.
The dtddecl
, sgmldecl
, and linktype
entries are not supported because they have no useful purpose in XML.
-
Method Summary
Modifier and TypeMethodDescriptionlookupDoctype
(String entityName, String systemId, String publicId) Lookup a document type.Lookup a default document.lookupEntity
(String entityName, String systemId, String publicId) Lookup an entity.lookupNotation
(String notationName, String systemId, String publicId) Lookup a notation.lookupPublic
(String systemId, String publicId) Lookup an external identifier by public and system identifier.lookupSystem
(String systemId) Lookup an external identifier by system identifier.Lookup a URI.
-
Method Details
-
lookupURI
Lookup a URI.This method searches
uri
,rewriteURI
,uriSuffix
, anddelegateURI
catalog entries.- Parameters:
uri
- The request URI- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupPublic
Lookup an external identifier by public and system identifier.This method searches
public
,delegatePublic
,system
,delegateSystem
,rewriteSystem
, andsystemSuffix
catalog entries.If both public and system mappings exist, the match depends on the setting of the "prefer public" option.
Note that public identifiers can be encoded as URNs per RFC 3151. A call to:
lookupPublic("urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN", null)
Is precisely the same as a call to
lookupPublic(null, "-//OASIS//DTD DocBook XML V4.1.2//EN")
If both the public and system identifiers are
null
,null
is returned.- Parameters:
systemId
- The system identifier, possibly null.publicId
- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupSystem
Lookup an external identifier by system identifier.This method searches
system
,delegateSystem
,rewriteSystem
, andsystemSuffix
catalog entries.- Parameters:
systemId
- The system identifier.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupDoctype
Lookup a document type.This method searches for a document type. A document type, for example:
<!DOCTYPE book SYSTEM "urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN">
Consists of an entity name ("book") and optional system and public identifiers. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.
If no external identifier is provided, the
entityName
will be matched againstdoctype
catalog entries.- Parameters:
entityName
- The entity name.systemId
- The system identifier, possibly null.publicId
- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupEntity
Lookup an entity.This method searches for an entity. An entity:
<!ENTITY chapter1 SYSTEM "chap1.xml">
consists of an entity name ("chapter1") and an external identifier. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.
If no external identifier is provided, the
entityName
will be matched againstentity
catalog entries.- Parameters:
entityName
- The entity name.systemId
- The system identifier, possibly null.publicId
- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupNotation
Lookup a notation.This method searches for a notation. A notation:
<!NOTATION thing SYSTEM "thing.bin">
consists of a notation name ("thing") and optional system and public identifiers. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.
If no external identifier is provided, the
notationName
will be matched againstnotation
catalog entries.- Parameters:
notationName
- The notation name.systemId
- The system identifier, possibly null.publicId
- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupDocument
URI lookupDocument()Lookup a default document.- Returns:
- The URI of the default document, or null if no mapping was found.
This method returns (the first) matching
document
entry.
-