com.ibm.xml.xapi

Interface XSourceResolver



  • public interface XSourceResolver

    Implement this class to override the default source document resolution behaviour. Register with the static context to resolve imports and includes. Register with the dynamic context to resolve documents loaded using the XPath fn:doc function and the XSLT document function.

    The default source resolution behaviour for imports and includes is to use the base URI of the expression, query, or stylesheet to resolve relative URIs. If the base URI is not available, the current working directory is used. Absolute URIs are used unchanged.

    The default source resolution behaviour for documents loaded using the XPath fn:doc function is to resolve relative URIs based on the base URI from the static context. If the base URI is not available, the current working directory is used. Absolute URIs are used unchanged.

    The default source resolution behaviour for documents loaded using the XSLT document function is described in the XSLT 2.0 specification: Multiple Source Documents. If no base URI is available, the current working directory is used.

    See Also:
    XStaticContext.setSourceResolver(XSourceResolver), XDynamicContext.setSourceResolver(XSourceResolver)
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      javax.xml.transform.Source getSource(java.lang.String uri, java.lang.String base)
      Get the source document for the given URI and base.
    • Method Detail

      • getSource

        javax.xml.transform.Source getSource(java.lang.String uri,
                                           java.lang.String base)
        Get the source document for the given URI and base. If the source resolver is registered with the static context, this method will be called for resolution of imports and includes. If the source resolver is registered with the dynamic context, this method will be called for the XPath fn:doc function and the XSLT document function.
        Parameters:
        uri - The URI which may be relative or absolute.
        base - The base URI.
        Returns:
        The source document or null to use the default resolution behaviour.
IBM WebSphere Application Server XML API JavadocTM
Release 8.5