我正在解析这个XML Document,但是得到了:
org.xml.sax.SAXParseException: Unexpected token (position:TEXT Parameter not sp...@1:# in java.io.InputStreamReader@4124af00)
我也尝试了This Link,This Link,但没有得到任何解决方案
这是我的代码,我将String Data
从HttpResponse
转换为Document
并获取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;
}
}
我该如何解决,请帮助我...