xsl-list
[Top] [All Lists]

Re: another quest

2002-08-29 04:58:51
Hi again,
I have this xml file:
<table>
<tr>
<td> tony </td>
<td> 100 </td>
</tr>
<tr>
<td> rony </td>
<td> 99 </td>
</tr>
</table>

I want to to search for "rony" to get the value of the following sibling
(which is in this case 99). How can I do it in xsl???
Thx

This gets just the "99":

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:strip-space elements="*" />
    <xsl:output method="text" />

    <xsl:template match="text()" />

    <xsl:template match="td[normalize-space(.)='rony']">
        <xsl:value-of select="normalize-space(following-sibling::td)" />
    </xsl:template>

</xsl:stylesheet>

Helder.

--
Helder da Rocha (helder(_at_)argonavis(_dot_)com(_dot_)br)
Web Consultant
www.argonavis.com.br
São Paulo, Brazil
+55 (11) 9291 0567



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>