fr.tireme.shared.xml.dom.dom3
Class MyDOM3ResourceResolver

java.lang.Object
  extended by fr.tireme.shared.xml.dom.dom3.MyDOM3ResourceResolver
All Implemented Interfaces:
org.w3c.dom.ls.LSResourceResolver

public class MyDOM3ResourceResolver
extends java.lang.Object
implements org.w3c.dom.ls.LSResourceResolver

Resolver used by the DOM3ErrorHandler load parser in order to find DTD and other PUBLIC defined files. The resolver assumes that the system catalog is sent using java system parameter xml.catalog.files

Since:
oct 2004
Version:
4.0
Author:
Bruno Chatel - Pierre Attar ;

Constructor Summary
MyDOM3ResourceResolver(java.lang.String catalog)
           Constructs a catalog resolver with a default configuration.
 
Method Summary
 java.lang.String resolvePublic(java.lang.String publicId, java.lang.String systemId)
           Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists.
 org.w3c.dom.ls.LSInput resolveResource(java.lang.String type, java.lang.String namespaceURI, java.lang.String publicId, java.lang.String systemId, java.lang.String baseURI)
           
 java.lang.String resolveSystem(java.lang.String systemId)
           Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyDOM3ResourceResolver

public MyDOM3ResourceResolver(java.lang.String catalog)
                       throws java.io.IOException

Constructs a catalog resolver with a default configuration.

Parameters:
catalog - String
Throws:
java.io.IOException
Method Detail

resolveResource

public org.w3c.dom.ls.LSInput resolveResource(java.lang.String type,
                                              java.lang.String namespaceURI,
                                              java.lang.String publicId,
                                              java.lang.String systemId,
                                              java.lang.String baseURI)
Specified by:
resolveResource in interface org.w3c.dom.ls.LSResourceResolver

resolveSystem

public final java.lang.String resolveSystem(java.lang.String systemId)
                                     throws java.io.IOException

Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists. If the system identifier is an URN in the publicid namespace it is converted into a public identifier by URN "unwrapping" as specified in the XML Catalogs specification.

Parameters:
systemId - the system identifier to locate in the catalog
Returns:
the mapped URI or null if no mapping was found in the catalog
Throws:
java.io.IOException - if an i/o error occurred while reading the catalog

resolvePublic

public final java.lang.String resolvePublic(java.lang.String publicId,
                                            java.lang.String systemId)
                                     throws java.io.IOException

Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists. Public identifiers are normalized before comparison.

Parameters:
publicId - the public identifier to locate in the catalog
systemId - the system identifier to locate in the catalog
Returns:
the mapped URI or null if no mapping was found in the catalog
Throws:
java.io.IOException - if an i/o error occurred while reading the catalog