This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Multiple Sorts problem
- From: Jitu <jibhatia at andiamo dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sat, 24 Aug 2002 22:09:44 +0530
- Subject: [xsl] Multiple Sorts problem
- References: <037a01c24952$db927670$0201a8c0@spearreport.local>
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have following sort conditions :
<xsl:sort
select="child::node()[position() = $sortColPos]" order="{$sOrder}"/>
<xsl:sort
select="child::node()[local-name() = $sortColName1]" order="{$sOrder}"/>
<xsl:sort
select="child::node()[local-name() = $sortColName2]" />
If $sortColPos has a valid value like 1, 2 etc.. it works.
But if does not have a valid value..for example it has a "" or
'1000000' (not valid for my case), then the sort conditions following it
simply fail. They do not work.
What i want is that, if the $sortColPos has invalid value, the first
sort should obviously not happen, but the two sorts statements following
it should succeed.
The idea is i may either have the first SORT condition valid, OR the Two
sort conditions following it valid. All three will never be valid. Since
i cannot use sort statements within IF conditions...i put all of them
one after another, assuming whichever conditio does not satisfy, that
sort statement will simply be ignored.
Pls let me know your valuable inputs.
Thanks.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list