Class ClasspathResourceResolver

java.lang.Object
org.openehealth.ipf.commons.xml.ClasspathResourceResolver
All Implemented Interfaces:
net.sf.saxon.lib.ResourceResolver

public class ClasspathResourceResolver extends Object implements net.sf.saxon.lib.ResourceResolver
ResourceResolver used to correctly resolve import commands in xslt or xquery content. The referenced resource (stylesheet or document) can be found somewhere in the classloader's classpath. If it can't be found, the default ResourceResolver is used.
Author:
Quentin Ligier
  • Constructor Details

    • ClasspathResourceResolver

      public ClasspathResourceResolver(net.sf.saxon.lib.ResourceResolver resolver)
      Constructor.
      Parameters:
      resolver - The standard resolver to use if the resource isn't found in the classpath.
  • Method Details

    • resolve

      public Source resolve(net.sf.saxon.lib.ResourceRequest resourceRequest) throws net.sf.saxon.trans.XPathException
      Resolve by searching the classpath, fallback to default resolution strategy.
      Specified by:
      resolve in interface net.sf.saxon.lib.ResourceResolver
      Parameters:
      resourceRequest - The SAXON resource request.
      Returns:
      the resource Source.
      Throws:
      net.sf.saxon.trans.XPathException - if the request is invalid in some way, or if the identified resource is unsuitable, or if resolution is to fail rather than being delegated to another resolver.