Subject: Re: matching nodes by their value From: "Jonas" <bob@xxxxxxxxxx> Date: Wed, 16 Aug 2000 16:18:39 +0200 |
Hello again, After some experiments I found out that both <xsl:for-each select="tr/td[position()=2/a[starts-with(.,$string)]"> and <xsl:for-each select="tr/td[position()=2]/a[starts-with(tr/td[position()=2]/a,$string)]">. work the same, so the problem probably somewhere else. I have such html: <html> <head><title>Title</title></head> <body> <table><tr><td>..</td></tr></table> <table> <tr> <td><a href="http://">..</a></td> <td><a href="http://">AAA</a></td> </tr><tr> <td><a href="http://">..</a></td> <td><a href="http://">BBB</a></td> </tr> </table> </body> </html> and xsl I am trying to use looks like this: ... <xsl:template match="table[position()=2]"> <p> <xsl:element name="table"> <xsl:attribute name="columns">1</xsl:attribute> <xsl:apply-templates select="tr/td[position()=2]/a[starts-with(tr/td[position()=2]/a,'A')]"/> </xsl:element> </p> </xsl:template> <xsl:template match="td[position()=2]/a"> <tr><td> <xsl:value-of select="."/> </td></tr> </xsl:template> the result I get: <p><table columns="1"/></p> if starts-with(tr/td[position()=2]/a,'A') is changed to starts-with(tr/td[position()=2]/a,'') then the result is: <p><table columns="1"><tr><td>AAA</td></tr><tr><td>BBB</td></tr></table></p> That looks strange for me. What can be wrong here? Jonas. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: matching nodes by their value, Harbarth, Juliane | Thread | Re: matching nodes by their value, Robert Stupak |
RE: template that matches all child, Ben Robb | Date | Re: xsl:template that matches all c, Miloslav Nic |
Month |