I have below string CDATA format from the response of a webservice call.
String outputString = "<![CDATA[<MYTAG><MYTAG1 type=\"java.util.vector\"><MyTAG2 type=\"java.util.hashtable\"><NAME type=\"java.lang.string\">XYZ</NAME><ADDRESS type=\"java.lang.string\">ABCD</ADDRESS></MYTAG2></MYTAG1></MYTAG>]]>"
When i tried with DOM parser. This string is giving exception.
DocumentBuilder builder;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
builder = factory.newDocumentBuilder();
Document outputXMLDocument = builder.parse(new InputSource(new StringReader(outputString)));
NodeList nodes = outputXMLDocument.getElementsByTagName("MYTAG");
I want to parse this respone and retrieve the value of NAME and ADDRESS TAG. Please advice for best way to handle this.