解决java.net.MalformedURLException: unknown protocol: c问题

修改前代码:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(xmlPath);\\直接将路径名给builder.

改后:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse("file:///" + xmlPath);
posted @ 2016-08-18 00:26  243573295  阅读(11528)  评论(0编辑  收藏  举报