[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
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.
|
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
|