Last post Oct 18, 2005 06:54 PM by ChicoUser
None
0 Points
154 Posts
Oct 18, 2005 06:54 PM|ChicoUser|LINK
None
0 Points
154 Posts
Breaking on last element/node of nodeset thru XSLT Transform: using last() and position()
Oct 18, 2005 06:54 PM|ChicoUser|LINK
The following transform snippet adds a break html tag and non breaking space only if the current node is not the last of the nodeset. Enjoy.
<xsl:if test="not(position()=last())">
<br /><xsl:text> </xsl:text>
</xsl:if>
This is specially useful when transforming XML nodes into delimited lists. It replaces the old last-of-type() function: this reminds I need a new copy of my XML Pocket Reference.
-
Francisco
(A+,MCP,.NET Framework Certified)