xsl-list
[Top] [All Lists]

position() seems always to be 1

2003-05-27 02:54:41
Hy,

I have a little position() problem and here is what I like to do:
I have sect elements with download elements in it, now I want to format each 
last download inside each sect in another way.

And here is what I tried but doesn't work, it always uses the otherwise 
formatting: 

<xsl:template match="sect/download">
...

<xsl:choose>
                                <xsl:when 
test="self::node()[position()=last()]">
                          
                                          <tr id="downloadBox">
                                                <td width="130" height="1" 
colspan="3"><img src="img/others/spacer.gif" height="1" width="130"/></td>
                                          </tr>
                                </xsl:when>
                                
                                <xsl:otherwise>
                                          <tr id="downloadBox">
                                                <td width="130" height="1" 
colspan="3" bgcolor="#006699"><img src="img/others/spacer.gif" height="1"       
                                                             width="130"/></td>
                                          </tr>
                                </xsl:otherwise>
</xsl:choose>

</xsl:template>


If I use  <xsl:when test="self::node()[position()=1]">  all download elements 
are processed, it seems that every download elements returns 1... but this 
cannot be or?


Thanks for your help.

Steve


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



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