This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in reading xml file??

 
Gaurav Jain
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic