i am trying to read a xml file and convert in to a DOM object. Following is the code: DocumentBuilder objBuilder = objFactory.newDocumentBuilder(); File f = new File("P:/My Documents/IBM/wsappdev51/workspace/MyXML/xmlproperties/NewFile.xml"); objDOM = objBuilder.parse(f);
I am getting the DOM object as null. I guess its not able to find the xml file although when i print "f" it gives me the correct path of the file. What is the problem??
I've never heard of the DocumentBuilder#parse(...) method returning a null (I believe the JAXP specification states that a compliant parser implementation should always either return an org.w3c.dom.Document object or throw an exception). Which parser implementation are you using?