I am having JSON output string in the following structure.
{
"Results": [
{ "Result": 5756 },
{ "Result": 5234 },
{ "Result": 5432 }
]
}
From this, I want to access each element (one by one – 5756, 5234, 5432) of “Results” array.
In order to read/extract the element, I am using “XPath”. I have tried many XPaths, however got no luck thus far; following are few of them.
- //*[1].Result -- Invalid xPath
- //*[1].Result[0] -- Invalid xPath
- //*[1]/Result[0] -- NULL
- //*[1]/Result -- NULL
And when used //*[1] It gives entire JSON string as following.
[
{ "Result": 5756 },
{ "Result": 5234 },
{ "Result": 5432 }
]
Could you please help me out to resolve the problem I am facing? Or In case, structure of JSON is required to be changed, suggest me new structure along with XPath to access array element, example would be appreciated.
Many thanks in advance.