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"));