diff --git a/src/main/java/info/textgrid/services/aggregator/html/HTML.java b/src/main/java/info/textgrid/services/aggregator/html/HTML.java
index 72e83648520107eccd2aaa6d60aad99aa7da2594..f80df4d4fcd0076c886b31d816db9b4e8aece8dc 100644
--- a/src/main/java/info/textgrid/services/aggregator/html/HTML.java
+++ b/src/main/java/info/textgrid/services/aggregator/html/HTML.java
@@ -16,17 +16,20 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.text.MessageFormat;
 import java.util.logging.Logger;
 
+import javax.servlet.ServletContext;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.core.StreamingOutput;
 import javax.xml.transform.stream.StreamSource;
@@ -44,27 +47,40 @@
 @Path("/html")
 public class HTML {
 
-	private static final URL TO_HTML_XSL = HTML.class.getClassLoader()
-			.getResource("db2xhtml.xsl");
+
+	private static final String TO_HTML_XSL = "/WEB-INF/stylesheets/db2xhtml.xsl";
 
 	private ITextGridRep repository = TextGridRepProvider.getInstance();
 
 	final Logger logger = Logger
-			.getLogger("info.textgrid.services.aggregator.EPUB");
+			.getLogger("info.textgrid.services.aggregator.html.HTML");
 
 	private XsltExecutable toHtml;
 	private final Processor xsltProcessor;
 
+	@Context
+	private ServletContext servlet;
+
+	private XsltExecutable getToHtml() {
+		if (toHtml == null) {
+			try {
+				final URL stylesheet = servlet.getResource(TO_HTML_XSL);
+				final XsltCompiler xsltCompiler = xsltProcessor
+						.newXsltCompiler();
+				toHtml = xsltCompiler.compile(new StreamSource(stylesheet
+						.toString()));
+			} catch (final MalformedURLException e) {
+				throw new IllegalStateException(e);
+			} catch (final SaxonApiException e) {
+				throw new IllegalStateException(e);
+			}
+		}
+		return toHtml;
+	}
+
 	public HTML(final ITextGridRep repository) throws IOException {
 		this.repository = repository;
 		xsltProcessor = new Processor(false);
-		final XsltCompiler xsltCompiler = xsltProcessor.newXsltCompiler();
-		try {
-			toHtml = xsltCompiler.compile(new StreamSource(TO_HTML_XSL
-					.openStream()));
-		} catch (final SaxonApiException e) {
-			throw new IllegalStateException(e);
-		}
 	}
 
 	@GET
@@ -105,7 +121,7 @@ public StreamingOutput get(@PathParam("object") final URI uri,
 			tei = repository.getContent(uri, sid);
 		}
 
-		final XsltTransformer transformer = toHtml.load();
+		final XsltTransformer transformer = getToHtml().load();
 		transformer.setSource(new StreamSource(tei));
 		transformer.setParameter(new QName("graphicsURLPattern"),
 				new XdmAtomicValue(repository.getCRUDRestEndpoint()
diff --git a/src/main/resources/db2xhtml.xsl b/src/main/webapp/WEB-INF/stylesheets/db2xhtml.xsl
similarity index 99%
rename from src/main/resources/db2xhtml.xsl
rename to src/main/webapp/WEB-INF/stylesheets/db2xhtml.xsl
index 9545917a1bba5065255e17b7642a616148d01d4d..9f3149fdd1ab82b726e2c3f5ef6fb5ecb5b496fb 100644
--- a/src/main/resources/db2xhtml.xsl
+++ b/src/main/webapp/WEB-INF/stylesheets/db2xhtml.xsl
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tgs="http://www.textgrid.info/namespaces/middleware/tgsearch" exclude-result-prefixes="xs tei tgs xi" xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
 
-   <xsl:import href="/usr/share/xml/tei/stylesheet/xhtml2/tei.xsl"/>
+   <xsl:import href="../tei/stylesheet/xhtml2/tei.xsl"/>
 <!--    <xsl:import href="/db/xslt/tei/xhtml2/tei.xsl"/> -->
 
 
diff --git a/src/test/java/info/textgrid/services/aggregator/html/HtmlIT.java b/src/test/java/info/textgrid/services/aggregator/html/HtmlIT.java
new file mode 100644
index 0000000000000000000000000000000000000000..a43c553d43451b04d97205632b7cf21fcbad773a
--- /dev/null
+++ b/src/test/java/info/textgrid/services/aggregator/html/HtmlIT.java
@@ -0,0 +1,31 @@
+package info.textgrid.services.aggregator.html;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+import com.google.common.io.ByteStreams;
+import com.google.common.io.NullOutputStream;
+
+public class HtmlIT {
+
+	@Test
+	public void testGet() throws IOException {
+		final URL url = new URL(System.getProperty("service.url")
+				+ "/html/textgrid:jfst.0");
+		final URLConnection connection = url.openConnection();
+		connection.setConnectTimeout(360000);
+		connection.connect();
+		Assert.assertEquals("text/html", connection.getContentType());
+		final InputStream content = connection.getInputStream();
+		final long realLength = ByteStreams.copy(content,
+				new NullOutputStream());
+		Assert.assertTrue("Content length > 0", realLength > 0);
+	}
+
+}