gpt4 book ai didi

机器人 : MalformedURLException: Protocol not found

转载 作者:行者123 更新时间:2023-11-29 00:40:19 25 4
gpt4 key购买 nike

如何解决这个问题?有什么帮助吗?

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

最佳答案

试试这个,让我知道会发生什么......

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

关于机器人 : MalformedURLException: Protocol not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9802348/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com