My xml structure is something like this :
<page height="777" width="777">
<block r="777" l="778" blockType="Text">
<region/>
<separator/>
</block>
<block r="777" l="790" blockType="Text">
<region/>
<separator/>
</block>
<block r="777" l="688" blockType="Text">
<region/>
<text/>
</block>
</page>
i want the select the block node which has the min "l" value i.e "688"
I know there is a min() function available in XPath 2.0, but i am using Xpath1.0.
I tried this
//XPathExpression pattern2TextExpr =
xPath.compile("//page/block[not(preceding-sibling::block/@l < = @l) and not(following-sibling::block/@l >@l)]/@l");
How can I use XPath to find the minimum value of an attribute in a set of elements?
But this gives me multiple nodelist. if it's min it should be only one node. Any other possible and efficient solution to this ?? Please suggest. Thanks