2012-03-21 5 views
2

問題を解決するには?どんな助け?アンドロイド:MalformedURLException:プロトコルが見つかりません

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

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

EDIT:SAXパーサーの :?

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

答えて

2

これを試してみて、私が起こるか知ってみましょう。..

File fXmlFile = new File(Paths.getBookStorePath()+book_name+"/OEBPS/content.opf"); 
    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); 
    DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); 
    Document doc = dBuilder.parse(fXmlFile); 
    doc.getDocumentElement().normalize(); 
+0

それは私のために働いた...どうもありがとうございました...しかし、私は私が使用SAX PARSER PLS SEE EDIT – vnshetty

+0

FOR同じ問題を抱えているが、 XMLReader型のメソッド解析(InputSource)は引数(File)には適用されません – vnshetty

+0

SAX Parserの完全なコードを投稿できますか? – user370305

関連する問題