Ask a Question

GroovyUtils XMLHolder throwing Xpath syntax error when XML node value contains escaped character.

tadudek
Occasional Contributor

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?

 

 

12 REPLIES 12
sonya_m
SmartBear Alumni (Retired)

Hi @tadudek , any updates on this? Thank you!


Sonya Mihaljova
Community and Education Specialist

tadudek
Occasional Contributor

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

sonya_m
SmartBear Alumni (Retired)

@tadudek , thank you for the update, really appreciated. Do not hesitate to ask the Community if you come across any questions along the way.


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: