Hi Guys,
I am trying to run the following very simple program on my machine to parse a very simple XML file.
It just returns Document object NULL.
Same code is working fine on another machine.
Note: there is no silly mistake. i have valid xml file at valid place.
Please help.
import org.apache.xerces.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import java.io.*;
class XML
{
public static void main(
String[] args)
{
try{
String caseFile = "c:\\case-config\\config.xml";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document
doc = builder.parse(caseFile);
System.out.println("\n\n----" + doc);
}catch(Exception e)
{
e.printStackTrace();
}
}
}