[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: Nick Glenister <NGlenister@xxxxxxxxxxxxxxxx>
Date: Thu, 2 Nov 2006 12:18:59 -0000
sort input output xml
Hi,

Sorry to bring this problem up again but I'm still having problems with
getting this sort to work.

To recap I have an XSLT that transforms XML into ASP.NET which shows a list
of financial products and some basic details. In order to sort these
products I am passing in a second XML document node in the following format:

<SortFields>
	<SortField>
		<Sort>lendername</Sort>
		<Order>ascending</Order>
		<DataType>text</DataType>
		<CaseOrder>lower-first</CaseOrder>
	</SortField>
	<SortField>
		<Sort>lenderid</Sort>
		<Order>ascending</Order>
		<DataType>text</DataType>
		<CaseOrder>lower-first</CaseOrder>
	</SortField>
	<SortField>
		<Sort>productid</Sort>
		<Order>ascending</Order>
		<DataType>text</DataType>
		<CaseOrder>lower-first</CaseOrder>
	</SortField>
</SortFields>


This xml is passed into this parameter:

<xsl:param name="sortField" as="document-node()"/>

This XML document defines three levels of sorting and is applied to the
primary XML using the following XSLT (separated over several lines for
clarity in the e-mail. There is one of these sort elements for each of the
three sorts):

<xsl:sort select="$sortField/SortFields/SortField[1]/Sort"
order="{$sortField/SortFields/SortField[1]/Order}" 
data-type="{$sortField/SortFields/SortField[1]/DataType}" 
case-order="{$sortField/SortFields/SortField[1]/CaseOrder}" />


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 so I'm sure that XSLT is
operating ok in all other repects.

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.