title: Reference is not allowed in prolog
body: <p>Please help me to find the reason for this exception ,am using following jars,</p>
  
  <pre><code>core-renderer.jar
  itext-paulo-155.jar
  </code></pre>
  
  <p><strong>firstdoc.xhtml</strong></p>
  
  <pre><code>&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
  &amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;
  &amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
      &amp;lt;head&amp;gt;
          &amp;lt;title&amp;gt;My First Document&amp;lt;/title&amp;gt;
          &amp;lt;style type="text/css"&amp;gt; b { color: green; } &amp;lt;/style&amp;gt;
      &amp;lt;/head&amp;gt;
      &amp;lt;body&amp;gt;
          &amp;lt;p&amp;gt;
              &amp;lt;b&amp;gt;Greetings Earthlings!&amp;lt;/b&amp;gt;
              We've come for your Java.
          &amp;lt;/p&amp;gt;
      &amp;lt;/body&amp;gt;
  &amp;lt;/html&amp;gt;
  </code></pre>
  
  <p><strong>JAVA :</strong></p>
  
  <pre><code>import java.io.File;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.OutputStream;
  
  import org.xhtmlrenderer.pdf.ITextRenderer;
  
  import com.lowagie.text.DocumentException;
  
  public class Sample1 {
      public static void main(String[] args)  throws IOException, DocumentException {
                  String inputFile = "C:/Users/Joseph.M/WorkPlace_Struts2/Fly-Sauccer/src/test/pdf/firstdoc.xhtml";
                  String url = new File(inputFile).toURI().toURL().toString();
                  String outputFile = "C:/Users/Joseph.M/WorkPlace_Struts2/Fly-Sauccer/src/test/pdf/firstdoc.pdf";
                  OutputStream os = new FileOutputStream(outputFile);             
                  ITextRenderer renderer = new ITextRenderer();
                  renderer.setDocument(url);
                  renderer.layout();
                  renderer.createPDF(os);             
                  os.close();
      }
  }
  </code></pre>
  
  <p><strong>Exception  :</strong></p>
  
  <pre><code>plumbing.render INFO:: Using CSS implementation from: org.xhtmlrenderer.context.StyleReference
  plumbing.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
  plumbing.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
  plumbing.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
  plumbing.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
  plumbing.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
  plumbing.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
  plumbing.load INFO:: Reference is not allowed in prolog.
  ERROR:  'Reference is not allowed in prolog.'
  plumbing.exception WARNING:: Unhandled exception. Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; Reference is not allowed in prolog.
  Exception in thread "main" org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; Reference is not allowed in prolog.
      at org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:191)
      at org.xhtmlrenderer.resource.XMLResource.load(XMLResource.java:71)
      at org.xhtmlrenderer.swing.NaiveUserAgent.getXMLResource(NaiveUserAgent.java:118)
      at org.xhtmlrenderer.pdf.ITextRenderer.loadDocument(ITextRenderer.java:98)
      at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:102)
      at test.pdf.Sample1.main(Sample1.java:23)
  Caused by: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; Reference is not allowed in prolog.
      at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
      at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
      at org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:189)
      ... 5 more
  Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; Reference is not allowed in prolog.
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)
  </code></pre>