This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: weird behavior with last()


> <xsl:template match="MainMenuItem">
> <b><a href="{@URL}"><xsl:apply-templates
> /></a></b><xsl:if
> test="position()!=last()">&#32;|&#32;</xsl:if>
> </xsl:template>
>
> If I transform it like it is, I get an end "|" after
> the last <MainMenuItem> (not correct behavior)

You can't tell whether a MainMenuItem is the last() by looking at the source
XML or by looking at this template rule. You can only tell by looking at how
the template rule is invoked. The last() item is the last one in the set of
nodes selected by the <xsl:apply-templates/> instruction that caused this
template to be invoked - which you haven't shown us.

Mike Kay
Software AG
>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]