• http://shansun123.iteye.com/blog/1020425
  • http://blog.csdn.net/hailanzhijia/article/details/6004947
  • 解析xml时,报找不到.dtd错误,从而解析错。

    解决方法:

    在使用builder解析之前,设置禁止校验dtd。

    builder.setEntityResolver(
                    new EntityResolver(){
                       public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
                           return new InputSource(new StringBufferInputStream(""));   
    //                       return null;//这个的效果仍然是从网络来抓取DTD来验证