try {
URL url = getNonDefaultStylesheetURL() == null ? getDefaultStylesheetURL() : getNonDefaultStylesheetURL();
if (getLog().isDebugEnabled()) {
getLog().debug("Using stylesheet: " + url.toExternalForm());
}
uriResolver = new StylesheetResolver("urn:docbkx:stylesheet", new StreamSource(url.openStream(), url
.toExternalForm()), catalogResolver);
} catch (IOException ioe) {
throw new MojoExecutionException("Failed to read stylesheet.", ioe);
}
return uriResolver;