This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes while parsing Inputsource returns document gets NULL 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 "while parsing Inputsource returns document gets NULL" Watch "while parsing Inputsource returns document gets NULL" New topic
Author

while parsing Inputsource returns document gets NULL

Anand Loganathan
Greenhorn

Joined: Sep 13, 2003
Posts: 12
I am getting response XML as string from JAX-RPC. I need to parse this document and read it by using DOM. This is my following code.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource in = new InputSource(new StringReader(xml));
//new StringReader(xml);
Document dom = builder.parse(in);

Here, in this case while builder.parse returns null value. Any idea where I am making mistake.

your help is highly appreciated.
Anand Loganathan
Greenhorn

Joined: Sep 13, 2003
Posts: 12
The problem got resolved. I was making mistake while reading the document.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: while parsing Inputsource returns document gets NULL
 
It's not a secret anymore!