Quantcast
Viewing latest article 3
Browse Latest Browse All 5

Validating xml node values using XPath

I have an XML structure that looks like below :

<a><b><c>123</c><d><e><f><g>1</g></f><h><i>2</i></h><j><k><l>1.2</l></k><m><n>34</n><o>String</o></m></j></e></d></b><b><c>456</c><d><e><f><g>7</g></f><h><i>6</i></h><j><k><l>4.5</l></k><m><n>43</n><o>String 2</o></m></j></e></d></b></a>

All the nodes are repetitive & I am not sure in which Order they repeatfor ex : Node c : 123 or 456 anything might come first in the order in my response

I want to compare that if C=123 then g=1 like wise if c=456 then g=7And all the subsequent nodes that come in the node b

so far I have tried this option but it fails in asserting the value of g

Option :/a/b/[@c=123]/a/b/d/e/f/g/text()=1


Viewing latest article 3
Browse Latest Browse All 5

Trending Articles