RE: [xsl] xsl:sort

Subject: RE: [xsl] xsl:sort
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 29 Aug 2005 08:25:16 +0100
The attributes such as order and data-type are AVTs (attribute value
templates) so you can use an XPath expression enclosed in curly braces.

The select attribute is already an XPath expression, and an XPath expression
can't contain curly braces. So you need to use

select="*[name()=//sort-Field]"

or the xx:evaluate() extension if the key is more than a simple element
name.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Asim Qazi [mailto:qazi@xxxxxxxxxxx] 
> Sent: 29 August 2005 07:39
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] xsl:sort
> 
> Hi All
> 
> i m using
> <xsl:sort order="descending" data-type="text" 
> select="get-users-UserName"/>
> 
> the question is that can i send order,data-type and select 
> attributes in xml
> and use them accordingly ?? like
> 
> <xsl:sort order="{//sort-Order}" data-type="{//sort-DataType}"
> select="{//sort-Field}"/>
> 
> where nodes values would be.
> sort-Order == descending
> sort-DataType == text
> sort-Field == get-users-UserName
> 
> 
> qAZI aSIM.

Current Thread