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

Re: Sorting a variable that contains a nodeset

Subject: Re: Sorting a variable that contains a nodeset
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 10 Jan 2002 16:23:03 +0000
Re:  Sorting a variable that contains a nodeset
Hi Rafael,

> I have a variable containing a nodeset as <xsl:variable name="var"
> select="//ARTICULO"/> and I want to order this nodeset by the node
> 'NOMBRE_FAMILIA'. How can I perform it? Exists any function that
> sorts the variable?

Because collections of nodes are *sets* in XSLT 1.0, they are
unordered by definition. But you can process the nodes in the set in a
particular order using xsl:sort when you use xsl:for-each:

  <xsl:for-each select="$var">
    <xsl:sort select="NOMBRE_FAMILIA" data-type="number" />

Or when you apply templates:

  <xsl:apply-templates select="$var">
    <xsl:sort select="NOMBRE_FAMILIA" data-type="number" />



Jeni Tennison

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

Current Thread


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.
First Name
Last Name
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.