ContributionsMost RecentMost LikesSolutionsRe: GroovyUtils XMLHolder throwing Xpath syntax error when XML node value contains escaped character. Frankly, this was taking way too long, and with all the craziness in the world, I can't spend any time on it right now. I went back the long (and tedious) way, and changed my groovy datasink back to an excel data sink, and now need to manually map xml nodes back to excel row-cells. (This really doesn't do what I want it to do, but it'll do for now.) I created an enhancement request for the excel datasink, because it forces you to map recurring elements, which is weird. And from a groovy perspective, there just isn't enough documentation on the groovy datasink to best do what I would like to do. I feel like I'm doing too much guessing. I'll follow up next week with some attempt at the communities changes. Thanks -tadudek Add datasink properties as header automatically to the file. Add datasink properties as header automatically to the file. There's no reason that in the datalog, the properties appear as headers, yet in the actual file, they're missing. Excel datasink to consume repeating xml elements without having to map multiple properties Currently there's no functionality that provides the abiltiy to map an XML rest response with repeating elements to a datasink without mapping each indivitual repeating element. Example: https://community.smartbear.com/t5/SoapUI-Pro/How-to-map-repeating-elements-from-xml-response-to-datasink/m-p/199559#M45747 Is there a way to map a repeating element from a response into a datasink automatically, rather than having to click getData and manually clicking each one. So, if I have 25 repeating elements. Widgets again. They all have the same attributes. A1, A2, A3. I want my sink to collect each of the attributes from each of the widgets, but I don't want to have to map it explicitly in the data sink property and the every one of the 25 widgets (x3 attributes) in my response. example: <widgets> <widget> <att1>abc</att1> <att2>xyz</att2> <att3>asd</att3> </widget> <widget> <att1>abc</att1> <att2>xyz</att2> <att3>asd</att3> </widget> ... </widgets> In my datasink, I'd like to map these out 1 element to 1 row in excel: excel row 1 (first widget): att1: abc, att2: xyz, att1: asd excel row 2 (second widget): att2: abc, att2: xyz, att1: asd What I'm trying to avoid is this: All the way through dozens of these objects. Re: How to map repeating elements from xml response to datasink sonya_m nmrao https://community.smartbear.com/t5/ReadyAPI-Feature-Requests/Excel-datasink-to-consume-repeating-xml-elements-without-having/idi-p/199629 I've added a feature request. I wasn't sure if I was using the tool correctly, or if I needed to request an enhancement; either way, I put it in! If someone is reading this, please go upvote the feature. ;) Other similar issues: https://community.smartbear.com/t5/SoapUI-Pro/ReadyAPI-Datasink-How-to-save-multiple-rows-from-response-into/td-p/171403 https://community.smartbear.com/t5/SoapUI-Pro/How-can-I-datasink-all-the-values-of-a-given-parent-when-they/m-p/171466/highlight/false#M39014 Re: Excel datasink to consume repeating xml elements without having to map multiple properties Other similar issues: https://community.smartbear.com/t5/SoapUI-Pro/ReadyAPI-Datasink-How-to-save-multiple-rows-from-response-into/td-p/171403 https://community.smartbear.com/t5/SoapUI-Pro/How-can-I-datasink-all-the-values-of-a-given-parent-when-they/m-p/171466/highlight/false#M39014 Re: GroovyUtils XMLHolder throwing Xpath syntax error when XML node value contains escaped character. nmrao 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. Re: GroovyUtils XMLHolder throwing Xpath syntax error when XML node value contains escaped character. nmrao 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: log.info holder.getDomNode(err).toString() 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. Re: GroovyUtils XMLHolder throwing Xpath syntax error when XML node value contains escaped character. 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. GroovyUtils XMLHolder throwing Xpath syntax error when XML node value contains escaped character. 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: Caused by: java.lang.RuntimeException: net.sf.saxon.trans.XPathException: XPath syntax error at char 9 on line 2 in {\nInvalid part number}: Unexpected token name "part" beyond end of expression 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? Re: How to map repeating elements from xml response to datasink nmrao Yeah, I was trying to get around having to write script. I know you can just use a xml map in excel and hit import, but I don't want to do that step manually. Was hoping there was a similar feature.