tags:

views:

14

answers:

1

I am trying to convert an Xml String to XML DOM object using Xerces (xercesImpl-2.8.1.jar).

But it seems that it provides only following methods, it does not offer a method that would take an XML string and convert it to an Object.

  • parse(File f)
  • parse(InputSource is)
  • parse(InputStream is)
  • parse(String uri)

Any pointers would be great.

+1  A: 

Never mind .I finally found it One could convert the Xml string to Reader

java.io.StringReader xmlReader = new java.io.StringReader(xml); Document doc = docBuilder.parse(new InputSource(xmlReader));

Sudhakar