I had this exception
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 39; Content is not allowed in prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:188)
when using XMLDog sniff()
method.
My Java code is
String xml = "..."
XPathResults results = xmlDog.sniff(new InputSource(new StringInputStream(xml)));
as you can see I have my XML in String, so there is no problem with UTF-8 BOF, also I'm sure that there are no whitespaces in xml
string...