Experts:
I'm trying to read an XML file. Here is my code.
dbf = DocumentBuilderFactory.new
Instance()
;
db = dbf.newDocumentBuilder();
doc = db.parse(pathAndFileName);
// ensure string includes the double slashes //"c:\\vehicles.xml"); // get dom representation of file
The filepath and name are correct. But when I get to the last line (doc = db.parse(pathAndFileName);
)
I get this error:
java.net.MalformedURLExcep
tion: unknown protocol: c
at java.net.URL.<init>(Unknow
n Source)
at java.net.URL.<init>(Unknow
n Source)
at java.net.URL.<init>(Unknow
n Source)
Start Free Trial