Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

while parsing Inputsource returns document gets NULL

 
Anand Loganathan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem got resolved. I was making mistake while reading the document.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic