aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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