2 slaks SLaks 于 2013.06.24 13:17 提问

MalformedURLException: Protocol not found 错误

MalformedURLException: Protocol not found
如何解决这个问题?

ERROR : java.net.MalformedURLException: Protocol not found: /mnt/sdcard/EREADER/NewForestPonies/OEBPS/content.opf

代码:

//Getting the xhtml file names
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                String 
                Document doc = db.parse(new InputSource(Environment.getExternalStorageDirectory()+"/EREADER/"+book_name+"/OEBPS/content.opf")); //ERROR HERE
                doc.getDocumentElement().normalize();

          ..........
          ......

对于 SAX 解析器?

DataSaxHandler myXMLHandler = new DataSaxHandler();
            xr.setContentHandler(myXMLHandler);
            xr.parse(new InputSource(Paths.getBookStorePath()+bookname+"/OEBPS/content.opf"));

1个回答

wocanimanimazhale
wocanimanimazhale   2016.08.30 10:59

一样的错,我也好纳闷

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!