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

Re: Is it possible to create xsl:sort from input para

Subject: Re: Is it possible to create xsl:sort from input parameters using XSLT 2.0 (Saxon)?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Nov 2006 12:30:22 GMT
Re:  Is it possible to create xsl:sort from input  para
> The problem is that it doesn't work. There are no errors but the sorting
> does not occur. Doing a <xsl:value-of
> select="$sortField/SortFields/SortField[1]/Sort"/> brings through the string
> "lendername" I just can't see why the sorting is not working. Hard coding
> the value "lendername" sorts the output perfectly

That's the differenc (it's also a FFFAQ)

in select

select="lendername" 

the attribute is a XPath expression that selects an element, and the
string value of that element is used as the sort key.


select="'lendername'" 

the attribute is a XPath expression that selects a string, and the
value of that that is used as the sort key. So all items get teh same
sort key and no sorting happens.

the second example used a string literal but any expression evaluating
to that string (you had) will have the same result.



select="*[name()='lendername']" 

would again sort as you want, and replacing the string literal by the
expression based on your input parameter will also work.

David

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.