RE: [xsl] for-each order

Subject: RE: [xsl] for-each order
From: "McNally, David" <David.McNally@xxxxxxxxxx>
Date: Fri, 14 Dec 2001 12:28:27 -0500
Caveat: I'm a relative newbie, still weaning myself off disable output
escaping....

There are a variety of ways of reversing things - just search on the archive
for reverse, or see
http://sources.redhat.com/ml/xsl-list/2001-08/msg00243.html

but in this particular case I'm thinking that this (untested) might work:

 <xsl:variable name="position">
    <xsl:for-each select="$path">
	  <xsl:sort order="descending" select="position()"/>
       <xsl:value-of select="@value"/>,
    </xsl:for-each>
 </xsl:variable>

David.
--
David McNally            Moody's Investors Service
Software Engineer        99 Church St, NY NY 10007 
David.McNally@xxxxxxxxxx            (212) 553-7475 

> -----Original Message-----
> From: Charly [mailto:cohana@xxxxxxxxxxxxxxx]
> Sent: Friday, December 14, 2001 2:35 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] for-each order
> 
> 
> Hello,
> Is there a way to do <xsl:for-each ..... and looping backwards.
> 
> My XML looks like 
> <histo>
>    <bar value="60" legend="Jan" />
>    <bar value="77" legend="Feb" />
>    <bar value="53" legend="Mar" />
>    <bar value="14" legend="Apr" />
> </histo>
> 
> and I want to store 14,53,77,60 in a variable .
> 
> 
> <xsl:variable name="position">
>    <xsl:for-each select="$path">
>       <xsl:value-of select="@value"/>,
>    </xsl:for-each>
> </xsl:variable>
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


---------------------------------------

The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission.  If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited.  If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments.  Thank you.

Every effort is made to keep our network free from viruses.  You should, however, review this e-mail message, as well as any attachment thereto, for viruses.  We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message.

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


Current Thread