aspose file tools*
The moose likes XML and Related Technologies and the fly likes New to XML, need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "New to XML, need help" Watch "New to XML, need help" New topic
Author

New to XML, need help

Kajol Singh
Greenhorn

Joined: Oct 11, 2001
Posts: 1
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
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


SCJP, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New to XML, need help