GroovyUtils throwing error when XML node value contains escaped characters.
In my script, I'm accessing a node that contains the description of an error. That node when read by my XMLHolder throws this error:
It appears that the node I'm reading contains the value "\n", and when the holder tries to read it, it throws the error.
How can I read the node, with the escaped value, and not bomb out?
Here's the output from the log:
Tue Mar 31 15:45:21 MDT 2020: INFO: <?xml version="1.0" encoding="UTF-8"?> <errorDescription xmlns:p="http://www.ournamespace.com">Invalid part number</errorDescription>
It appears to be a non-printable char. I also just edited the namespace, as not put publish it on the forum.
I don't control the values being passed back in this response. So, I'm trying to grab the value (which comes out as a string if I use the holder.getNodeValue(xpath). That breaks, but I'm trying to get it into an excel file so that as I'm going through my response, if one of these items in my xml list has an error, I transcribe that to the file.
To get around it, it appears that I may be able to do something like this:
But, it's not exactly what I want.
Ideally, I just want pull what's there, regardless printable/non-printable chars. So, if I could just CDATA the content regardless of what's there, but the problem is, is that I can't get to it.
I can't really post my full reponse here from the HTTP log. It does come back in escaped values, shown here.
The RAW view in the response test step also will not let me scroll to copy the entire raw response. So, the error in question is too far over, and readyapi won't let me scroll over to see it.
Thank you for helping richie and nmrao!
@tadudek did you try impementing what the Community suggests? Please share your progress with us