Question : xpath select specific node

Using this xpath:
1:
<xsl:value-of select="//INPUT[substring(@name,1,11)='ltf_chosen_'][1]/@value"/>

on this document:
1:
2:
3:
4:
5:
6:
7:
8:
9:
<A>
    <B>
        <INPUT name="ltf_chosen_1" value="1"/>
    </B>
    <B>
        <INPUT name="ltf_chosen_2" value="2"/>
    </B>
</A>

returns: 1 2
whereas applying the same xpath to:
1:
2:
3:
4:
5:
6:
7:
<A>
    <B>
        <INPUT name="ltf_chosen_1" value="1"/>
        <INPUT name="ltf_chosen_2" value="2"/>
    </B>
</A>

returns just the first value: 1, which is what I want.
How can I modify the XPath so it only returns '1' from the first XML document, where the INPUT tags are inside separate 'B' tags ?

Answer : xpath select specific node

try
1:
(//INPUT[substring(@name,1,11)='ltf_chosen_'])[1]/@value
Random Solutions  
 
programming4us programming4us