SaxParse Exception意外的令牌

时间:2013-05-28 01:28:36

标签: android

我有这段代码:

Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
StringBuilder text = new StringBuilder();
Utilities parser = new Utilities();


try {
    BufferedReader br = new BufferedReader(new FileReader(xmlfile));
    String line;

    while ((line = br.readLine()) != null) {
        text.append(line);
        text.append('\n');
    }

    DocumentBuilder db = dbf.newDocumentBuilder();

    InputSource is = new InputSource();
    is.setCharacterStream(new StringReader(text.toString()));
    doc = db.parse(is);

} catch (IOException e) {

} catch (ParserConfigurationException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}  catch (SAXException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

我收到此错误

org.xml.sax.SAXParseException: Unexpected token (position:TEXT 030812Z_1_CDEE94...@1:60 in java.io.StringReader@4278b0f0) 

有没有人知道为什么我应该得到这个错误我在ICS和4.1上运行它并且它工作正常但是4.2我得到这个错误

0 个答案:

没有答案