Consider the following XML structure:
<a>
<b>
<c>
<d x="1"/>
<d x="2"/>
<d x="3"/>
<d x="3"/>
<d x="4"/>
</c>
</b>
<b>
<c>
<d x="1"/>
<d x="1"/>
<d x="2"/>
<d x="3"/>
<d x="4"/>
<d x="5"/>
<d x="5"/>
</c>
</b>
<b>
<c>
<d x="1"/>
<d x="2"/>
<d x="3"/>
<d x="3"/>
<d x="4"/>
<d x="5"/>
<d x="5"/>
</c>
</b>
I'd like a XPath 1.0 statement to give me the minimum and maximum values of @x? So far I have the following for the minimum:
//a/b/c/d[not(preceding-sibling::d/@x <= @x) and not(following-sibling::d/@x <= @x)]/@x
which is close, but no cigar :-(
Any help greatly appreciated!
Thanks, J