title: Transformation Failing due to xsl:include
body: <p>I have a Java maven project which includes XSLT transformations. I load the stylesheet as follows:</p>
  
  <pre><code>TransformerFactory tFactory = TransformerFactory.newInstance();
  
  DocumentBuilderFactory dFactory = DocumentBuilderFactory
                  .newInstance();
  
  dFactory.setNamespaceAware(true);
  
  DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
  
  ClassLoader cl = this.getClass().getClassLoader();
  java.io.InputStream in = cl.getResourceAsStream("xsl/stylesheet.xsl");
  
  InputSource xslInputSource = new InputSource(in);
  Document xslDoc = dBuilder.parse(xslInputSource);
  
  DOMSource xslDomSource = new DOMSource(xslDoc);
  
  Transformer transformer = tFactory.newTransformer(xslDomSource);
  </code></pre>
  
  <p>The stylesheet.xsl has a number of  statements. These appear to be causing problems, when I try to run my unit tests I get the following errors:</p>
  
  <pre><code>C:\Code\workspace\app\dummy.xsl; Line #0; Column #0; Had IO Exception with stylesheet file: footer.xsl
  C:\Code\workspace\app\dummy.xsl; Line #0; Column #0; Had IO Exception with stylesheet file: topbar.xsl
  </code></pre>
  
  <p>The include statements in the XSLT are relative links</p>
  
  <pre><code>xsl:include href="footer.xsl"
  xsl:include href="topbar.xsl"
  </code></pre>
  
  <p>I have tried experimenting and changing these to the following - but I still get the error.</p>
  
  <pre><code>xsl:include href="xsl/footer.xsl"
  xsl:include href="xsl/topbar.xsl"
  </code></pre>
  
  <p>Any ideas? Any help much appreciated.</p>