I'm trying to confirm that my implementation for registering Custom Resolvers is correct... I want the resolver to throw an "Unauthorized" error when a corresponding saxon xquery function is called.
First, I write a custom class along those lines:
class CustomURIResolver implements URIResolver{
public Source resolve(String href, String base) throws XPathException {
throw new XPathException("Illegal Operation");
}]
}
and then I set the resolver via the underlying config on the processor:
Processor proc = new Processor(false);
// Override SystemURIResolver
net.sf.saxon.Configuration xconfig = proc.getUnderlyingConfiguration();
xconfig.setURIResolver(new CustomURIResolver());
Is this reasonable or am I missing something?