Forum Discussion
Dheepha
13 years agoContributor
Hi Reshma,
I tried the following as per your comments and my code looks like:
def dateString = holderResponse.getNodeValue(".//ServerDt")
def date=dateString.toString()
Initially I have tried with the def dateString = holderResponse.getNodeValue(".//[ServerDt]") and I was getting
"java.lang.RuntimeException: net.sf.saxon.trans.XPathException: XPath syntax error at char 4 on line 2 in {\n.//[ServerDt}: Unexpected token "[" in path expression"
So I have removed the braces '[' , ']'.
But When I try to run , still I'm getting the null as the dateString.
Also I'm not sure where to use the substring function as the dateString is returning null. Could you please help me on this and correct my code if I made a mistake.
I tried the following as per your comments and my code looks like:
def dateString = holderResponse.getNodeValue(".//ServerDt")
def date=dateString.toString()
Initially I have tried with the def dateString = holderResponse.getNodeValue(".//[ServerDt]") and I was getting
"java.lang.RuntimeException: net.sf.saxon.trans.XPathException: XPath syntax error at char 4 on line 2 in {\n.//[ServerDt}: Unexpected token "[" in path expression"
So I have removed the braces '[' , ']'.
But When I try to run , still I'm getting the null as the dateString.
Also I'm not sure where to use the substring function as the dateString is returning null. Could you please help me on this and correct my code if I made a mistake.