Subject: Re: [xsl] Dynamically define number of xsl:sort stmts using parameters From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 27 Mar 2007 17:52:10 +0200 |
Good morning, list -
<sort order="1">name</sort> <sort order="2">city</sort> I can think of the following theoretical solutions, but I don't know if they are even possible:
1. (I know this doesn't work) Create multiple variables to evaluate the sort value and then hardcode the same number of <xsl:sort> statements that may be evaluating a null value for @select:
2. Use xsl to select the sort nodes and then dynamically write and output the template and for-each loop that uses the appropriate number of sort statements - then how would I call it in the same stylesheet?
3. Write multiple templates using 0 to n sort statements and then call the appropriate template based on the number of <sort/> nodes found? This doesn't sound very elegant or practical to me, but might be the simplest...
Any suggestions?
<!-- order of these elements is the order for the sort-key --> <xsl:variable name="sortkey"> <key nodename='name' order='ascending' type='string' /> <key nodename='street' order='ascending' type='string' /> <key nodename='birth-year' order='ascending' type='numberic' /> </xsl:variable>
Cheers, -- Abel Braaksma http://www.nuntia.nl
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Dynamically define number of , Angela Williams | Thread | RE: [xsl] Dynamically define number, Angela Williams |
RE: [xsl] Need help with sorting., Austin, Darrel | Date | RE: [xsl] Dynamically define number, cknell |
Month |