java - Content is not allowed in prolog -


Trying to convert HTML into

I use XML xslt I am To do this in Java I am using java.xml.transform . I was working fine as long as I did not collide in some xml . This is called the following error:

  [Fatal error]: 1: 1: Content is not permitted in Protol javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml Transform.TransformerException: org.xml.sax.SAXParseException: Content is not allowed in prolog.  

So I've ensured that there is no character before XML declaration. I also take care of BOM using the solution.

There is still no luck and it is only for one XML, I also opened XML in the editor and it was sent to utf-8 Save in file with encoding It's making me crazy. Any remedy?

UPDATE: You get this error when you entered the wrong path for the file xsl and no file was found Exception (this was my case, it helped you Someone can be helpful.)

If you have a utf-8 file , And if you use an XML parser which is not aware of it, without the BOM in the form of UOTF-8 as the XML file Save.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -