我用JDOM與SAXBuilder的解析XML文件,我有這是引發此錯誤的文件的問題:未知協議:C(JDOM一個SAXBuilder的)
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:986)
at com.foo.moo.MyClass.getValues(MyClass.java:321)
而行是:
Document document = null;
document = sxb.build(files.elementAt(i)); // This one
經過對互聯網的一些研究,我認爲這個錯誤與Java 1.6有關。
您認爲如何?
你能發佈導致問題的XML? – beny23