API

com.ibm.xml.xapi
Interface XModuleResolver


public interface XModuleResolver

Implement this class to override the default XQuery module resolution behaviour. Implementations should be registered with the XStaticContext and are used to resolve modules that are imported in XQuery using a module import.

The default behaviour for resolving modules is to use the base URI of the importing module to resolve the imported module's location. If the base URI is not available, the current working directory will be used. The processor will attempt to locate one module per location hint. If no modules can be located for the target namespace, an error will be raised.

See Also:
XStaticContext.setModuleResolver(XModuleResolver)

Method Summary
 List<? extends Source> getModule(String namespace, List<String> locations, String baseURI)
          Get the modules for the given namespace and locations.
 

Method Detail

getModule

List<? extends Source> getModule(String namespace,
                                 List<String> locations,
                                 String baseURI)
Get the modules for the given namespace and locations. It is recommended that each Source object included in the returned List have its system id set. This allows the processor to avoid parsing the same module more than once in the case where it is imported into more than one module.

Parameters:
namespace - The module namespace.
locations - The location hints for the module. These correspond to the URIs specified after the at in a module import. May be an empty list if none were specified.
base - The base URI.
Returns:
The modules for the given namespace and locations or null to use the default resolution behaviour. If an empty list is returned, an error will be raised.

IBM Copyright 2004-2008