Can someone explain me please how to read this expression in xpath:
/a/b[3]/preceding-sibling::*[1]/d/@id ?
(My problem is mainly to understand this part: preceding-sibling::*[1])
In given the following xml document:
<a>
<b>
<c ref="a5">2000</c>
<d id="a3">3</d>
<d id="a4">4</d>
<d id="a5">a</d>
<d id="a6">b</d>
<f></f>
</b>
<b>
<c ref="a5">3000</c>
<f></f>
<d id="a7">7</d>
<d id="a8">8</d>
<d id="a9">9</d>
</b>
<b>
<c ref="a6">4000</c>
<f></f>
</b>
</a>
Why it returns the following output:
Attribute='id=a7'
Attribute='id=a8'
Attribute='id=a9'