解决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 @ 2013-04-14 10:36  qiangzhu  阅读(6138)  评论(1编辑  收藏  举报