I'm parsing this XML Document, but getting the :
org.xml.sax.SAXParseException: Unexpected token (position:TEXT Parameter not sp...@1:# in java.io.InputStreamReader@4124af00)
I have tried This Link, This Link as well but didn't got any solution
This is my code where I convert String Data
which got from HttpResponse
, to Document
and getting Exception
:
protected Document convertWordDefinationToDocument(Context context,
String defSource) {
Document destDocument = null;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = null;
try {
documentBuilder = factory.newDocumentBuilder();
destDocument = documentBuilder.parse(new ByteArrayInputStream(defSource.getBytes("UTF-8")));// This is line where Exception occurs
return destDocument;
} catch (ParserConfigurationException e) {
e.printStackTrace();
return null;
} catch (SAXException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}catch (Exception e) {
return null;
}
}
How can I solve that please help me...