I have the following XML:
application/xml
local-C++
200
]]>
I'd like to parse out the following text from the content node as follows:
]]>
Notice here the content is wrapped in CDATA tags. How can I accomplish this in Java using any method.
Here is my code:
@Test
public void testGetDoOrchResponse() throws IOException {
String path = "/Users/haddad/Git/Tools/ContentUtils/src/test/resources/testdata/doOrch_testfiles/doOrch_response.xml";
File f = new File(path);
String response = FileUtils.readFileToString(f);
String content = getDoOrchResponse(response, "content");
System.out.println("Content: "+content);
}
// output: Content: blank
static String getDoOrchResponse(String xml,