[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: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 31 Jul 2006 17:52:53 +0100
RE:  Is it possible to create xsl:sort from input  para
> <xsl:param name="sortField"/>
> 
> And into this param i pass the XML:
> 
> <SortFields>
> 	<SortField>
> 		<Sort>lendername</Sort>
> 		<Order>ascending</Order>
> 		<DataType>text</DataType>
> 		<CaseOrder>lowercasefirst</CaseOrder>
> 	</SortField>
> </SortFields>
> 
> 
> rather than use 12 parameters (four for each <xsl:sort/>), I 
> had hoped that using this XML I would be able to read the 
> values out like so:
> 
> 	<xsl:sort select="$sortField/SortField[1]/Sort"
> order="{$sortField/SortField[1]/Order}"/> 

You want $sortField/SortFields/SortField[1]/Order
> 
> 
> As far as I can tell the order attribute should read 
> "acsending" out of the XML but I've no real way of finding 
> out what it is reading.

Take a look at the trace() function, or simply do <xsl:copy-of
select="$sortField"/>.

Better still, write a little schema for this XML document and make your
stylesheet schema-aware, and then the error will be reported to you at
compile time.

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

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.