ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: position in a conditional for-each

Subject: Re: position in a conditional for-each
From: Craig Pfeifer <cpfeifer@xxxxxxx>
Date: Wed, 3 Jan 2001 15:37:42 -0500 (EST)
xslt conditional for each
How about?:

<xsl:if test="position() = last()">
	... process last element differently ...
</xsl:test>

pg. 502 XSLT programmer's reference

--------
Craig Pfeifer
www.cpfeifer.org

On Wed, 3 Jan 2001, James Piva wrote:

> Hi,
> 
> 	I'm trying treat the last element that passes a 
> 	condition in a for-each differently.
> 	Every element which passes the condition
> 	displays its value, and that is followed by
> 	a comma.  The problem is that I can't know when
> 	the last element to meet the condition
> 	has passed.I would like to omit trailing comma.
> 
> 	<xsl:for-each select="COOLJEX_ATTRIBUTE">
>         <xsl:if test="@key='true'"> 
> 	    <xsl:value-of select="@name"/>
> 	    <xsl:text> , </xsl:text> 
> 	  </xsl:if>
> 	</xsl:for-each>
> 
> 	The only solution I can think of is to create a 
> 	stringBuffer which is updated each time through the
> 	condition, then create a substring of that for display.
> 	But I don't know how to create a 'local variable'.  I've
> 	looked at the xsl:attribute, but have not quite understood its
> 	functions.
> 
> 	please help,
> 
> 	thank you 
> 
> 	james
> 	
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.