tadudek
5 years agoOccasional 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?