Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Is it possible to create xsl:sort from input parameters using XSLT 2.0 (Saxon)?

From: David Carlisle <davidc@--------->
To:
Date: 11/2/2006 12:31:00 PM
> 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent