Reputation: 295
this is the input xml,
<student>
<roll-no>5</roll-no>
<name>patrick</name>
</student>
<student>
<roll-no>6</roll-no>
<name>steve</name>
</student>
<student>
<roll-no>7</roll-no>
<name>liz</name>
</student>
<student>
<roll-no>8</roll-no>
<name>smith</name>
</student>
need to get the name of the student if the roll-no is 7
so the output should be 'liz'
please help me.
Upvotes: 1
Views: 271
Reputation: 3435
Try this
<xsl:value-of select="//student[roll-no eq '7']/name"/>
Upvotes: 1