class XslCompiler {

    public XsltExecutable compileXsl(final InputStream inputStream, final Processor processor) throws SaxonApiException {
        XsltCompiler xsltCompiler = processor.newXsltCompiler();
        Source xslSource = streamSourceFactory.createStreamSource(inputStream);
        xsltCompiler.setErrorListener(errorListener);
        XsltExecutable xsltExecutable = xsltCompiler.compile(xslSource);
        return xsltExecutable;
    }

}