|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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" />
...
</xsl:for-each>
Or when you apply templates:
<xsl:apply-templates select="$var">
<xsl:sort select="NOMBRE_FAMILIA" data-type="number" />
</xsl:apply-templates>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








