title: Handle illegal URI characters in xslt inclusion
body: <p>In a xsl transformation I have a xslt file that includes some other xslt. The problem is that the URI for these xslt contains illegal characters, in particular '##'. The xslt looks like this:</p>
  
  <p><code>&lt;xsl:include href="/appdm/tomcat/webapps/sentys##1.0.0/WEB-INF/classes/xslt/release_java/xslt/gen.xslt" /&gt;</code></p>
  
  <p>and when I try to instantiate a java <code>Transformer</code> I get the error:</p>
  
  <p><code>javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: org.apache.xml.utils.URI$MalformedURIException: Fragment contains invalid character:#</code></p>
  
  <p>This is the java code:</p>
  
  <pre class="lang-java prettyprint-override"><code>public String xslTransform2String(String sXml, String sXslt) throws Exception {
      String sResult = null;
      try {
          Source oStrSource = createStringSource(sXml);
  
          DocumentBuilderFactory oDocFactory = DocumentBuilderFactory.newInstance();
          oDocFactory.setNamespaceAware(true);
  
          //sXslt is the xslt content with the inclusions 
          //&lt;xsl:include href="/appdm/tomcat/webapps/sentys##1.0.0/WEB-INF/classes/xslt/release_java/xslt/gen.xslt" /&gt;"
          Document oDocXslt = oDocFactory.newDocumentBuilder().parse(new InputSource(new StringReader(sXslt)));
          Source oXsltSource = new DOMSource(oDocXslt);
  
          StringWriter oStrOut = new StringWriter();
          Result oTransRes = createStringResult(oStrOut);
          Transformer oTrans = createXsltTransformer(oXsltSource);
  
          oTrans.transform(oStrSource, oTransRes);
          sResult = oStrOut.toString();
      } catch (Exception oEx) {
          throw new BddException(oEx, XmlProvider.ERR_XSLT, null);
      }
      return sResult;
  }
  
  private Transformer createXsltTransformer(Source oXsltSource) throws Exception {
      Transformer transformer = getXsltTransformerFactory().newTransformer(
              oXsltSource);
      ErrorListener errorListener = new DefaultErrorListener();
      transformer.setErrorListener(errorListener);
  
      return transformer;
  }
  </code></pre>
  
  <p>is there a way I can go with relative paths instead of absolute path?</p>
  
  <p>Thank you</p>