Use the InputStream
constructor of StreamSource
:
...new StreamSource(request.getServletContext().getResourceAsStream("lib/SorinCode.xsl"))
...if lib/SorinCode.xsl
is in the web content. If it is in the classpath, use instead:
...new StreamSource(getClass().getResourceAsStream("lib/SorinCode.xsl"))