Hi, I have just started reading about XML. I tried to run a small example on IBM'S VAJ, using DOM parser. For some reason it does'nt work: Here is the code: public static void main(String[] args){ DOMParser parser = new DOMParser(); String filename = "C:/xexample.xml"; try{ parser.parse(filename); Document doc = parser.getDocument(); } catch(Exception e) { System.out.println("Error in parsing" + e.getMessage()); }
} I have classpath set and included the directory c:/ in the class path. Could someone tell me what is wrong with this code??? Thanks, Kaj.
L Goundalkar
Ranch Hand
Joined: Jul 05, 2001
Posts: 395
posted
0
Hi, Club the the following lines to one line of code. try{ parser.parse(filename); Document doc = parser.getDocument(); } to try{ Document doc = parser.parse(filename); } Thanks. ------------------ L Goundalkar lggoundalkar@hotmail.com Sun Certified Programmer for Java 2 Platform
<b>L G Goundalkar</b><br /> <a href="mailto:lggoundalkar@yahoo.com" rel="nofollow">lggoundalkar@yahoo.com</a> <br />Sun Certified Programmer for Java 2 Platform.<br />Sun Certified Web Component Developer for J2EE.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.