12 years ago
Using XQuery for verifying the JSON content in response xml
We need to verify the JSON content which is residing inside the tag called "JSON" in the response xml.
Sample format as follows:
<result>
<param name="json">{"response":{"Result":"SUCCESS"}}</param>
</result>
For example ,in the above response we just need to confirm is Result tag is returing SUCCESS or not.
We have tried using below code
<Result>
{
for $z in /result/param[@name='json']
return<param>{$z/text()}</param>
}
</Result
We could verify the whole json using
<Result>
<param>{"response":{"Result":"SUCCESS"}}param>
</Result>
But we would require to verify only SUCCESS in the above response.
Could anyone please help us on this?
Sample format as follows:
<result>
<param name="json">{"response":{"Result":"SUCCESS"}}</param>
</result>
For example ,in the above response we just need to confirm is Result tag is returing SUCCESS or not.
We have tried using below code
<Result>
{
for $z in /result/param[@name='json']
return<param>{$z/text()}</param>
}
</Result
We could verify the whole json using
<Result>
<param>{"response":{"Result":"SUCCESS"}}param>
</Result>
But we would require to verify only SUCCESS in the above response.
Could anyone please help us on this?