title: How to resolve javax.xml.transform.TransformerConfigurationException
body: <p>I am trying to convert an xml file to html using xsl stylesheets. 
  Please see the code below. I have tried many ways to resolve the issue but somehow cant.
  If I open the xml file then I am able to see the desired output, but why am i not able to see the same through programming? </p>
  
  <p>Error Message:
      ERROR:  'Jaxpone.xsl'
      FATAL ERROR:  'Could not compile stylesheet'
      javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
          at   com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:885)
          at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:671)
          at crawler.JAXPExamples.basic(JAXPExamples.java:52)
          at crawler.JAXPExamples.main(JAXPExamples.java:40)</p>
  
  <pre><code>Please see the code below
  </code></pre>
  
  <p>package crawler;</p>
  
  <pre><code>import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.net.URL;
  import javax.xml.parsers.ParserConfigurationException;
  import javax.xml.transform.Transformer;
  import javax.xml.transform.TransformerConfigurationException;
  import javax.xml.transform.TransformerException;
  import javax.xml.transform.TransformerFactory;
  import javax.xml.transform.stream.StreamResult;
  import javax.xml.transform.stream.StreamSource;
  import org.xml.sax.SAXException;
  
  
  public class JAXPExamples {
  
  
      public static void main(String argv[])
          throws TransformerException, TransformerConfigurationException,
                 IOException, SAXException, ParserConfigurationException,                 
                 FileNotFoundException
          {
          try {
           URL xmlURL = new URL("file://Jaxpone.xml");
           String xmlID = xmlURL.toString();
           URL xslURL = new URL("file://Jaxpone.xsl");
  
  
           String xslID = xslURL.toString();
       //
           System.out.println("--- basic ---");
           basic(xmlID, xslID);
           System.out.println();
  
        } catch(Exception err) {
          err.printStackTrace();
        }
     }
        public static void basic(String xmlID, String xslID)
        throws TransformerException, TransformerConfigurationException
     {
        TransformerFactory tfactory = TransformerFactory.newInstance();
        Transformer transformer = tfactory.newTransformer(new StreamSource(xslID));
  
        StreamSource source = new StreamSource(xmlID);
        transformer.transform(source, new StreamResult(System.out));
     }
  
  }
  </code></pre>
  
  <p>XSLT file code</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
      &lt;xsl:template match="title"&gt;
          &lt;h2&gt;&lt;b&gt;&lt;xsl:value-of select="."/&gt;&lt;/b&gt;&lt;/h2&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match="pub_date"&gt;
          &lt;h5&gt;&lt;xsl:value-of select="."/&gt;&lt;/h5&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
          &lt;xsl:template match="section"&gt;
          &lt;p&gt;&lt;b&gt;&lt;xsl:value-of select="."/&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
          &lt;xsl:template match="author"&gt;
          &lt;p&gt;&lt;b&gt;&lt;xsl:value-of select="."/&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
          &lt;xsl:template match="link"&gt;
          &lt;p&gt;&lt;xsl:value-of select="."/&gt;&lt;/p&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
          &lt;xsl:template match="description"&gt;
          &lt;p&gt;&lt;xsl:value-of select="."/&gt;&lt;/p&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
          &lt;xsl:template match="body"&gt;
         &lt;p&gt;&lt;xsl:value-of select="."/&gt;&lt;/p&gt;&lt;br /&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match="/"&gt;
          &lt;html&gt;
          &lt;body&gt;
          &lt;xsl:apply-templates/&gt;
          &lt;/body&gt;
          &lt;/html&gt;
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>