[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: sorting

Subject: Re: sorting
From: "OBD" <zakons@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Jun 2002 12:18:29 -0400
 Re: sorting
That works. Thanks.
In case there is no sort column, will setting the variable $chosen to some
value like 0
disable the sort? This is desired so I don't have to use <xsl:if> to special
case the
sorting (there is a related thread on this topic but I want to confirm for
this example).

Also, I tried using an attribute directly  in the predicate instead of a
variable and it
didn't work. Is this supposed to work? Example:

<xsl:sort select="column[number(@sort-column)]"/>

Is this a valid predicate?  It is still better to use a variable, I believe,
because then
I could use <xsl:if> to set it to 0 if there was no sort-column attribute
and get the
benefits I described above, assuming it works that way.

Thanks,
Stuart Zakon
Objects by Design
http://www.objectsbydesign.com

XSLT by Example:
http://www.objectsbydesign.com/projects/xslt/xslt_by_example.html

>----- Original Message -----
>From: OBD
>To: Stuart Zakon
>Sent: Friday, June 14, 2002 9:06 AM
>Subject: sorting
>
>
>Date: Thu, 13 Jun 2002 12:02:05 +0100
>From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
>Subject: RE:  sorting by position?
>
>Sure:
><xsl:sort select="column[$chosen]"/>
>
>Michael Kay
>Software AG
>home: Michael.H.Kay@xxxxxxxxxxxx
>work: Michael.Kay@xxxxxxxxxxxxxx
>
>> -----Original Message-----
>> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
>> Stuart Zakon
>> Sent: 13 June 2002 03:47
>> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
>> Subject:  sorting by position?
>>
>>
>> Is there any way to sort using <xsl:sort> for a positional
>> sort? For instance, given the following XML for a generic
>> table, is there a way to specify to sort the rows by the
>> first or second column, depending on which column is chosen
>> to sort by?
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <table>
>> <row>
>> <column>x</column>
>> <column>b</column>
>> </row>
>> <row>
>> <column>z</column>
>> <column>c</column>
>> </row>
>> <row>
>> <column>y</column>
>> <column>a</column>
>> </row>
>> </table>
>>
>>
>> Thanks,
>> Stuart Zakon
>> Objects by Design
>>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Re: sorting
    • OBD - Fri, 14 Jun 2002 12:27:45 -0400 (EDT) <=
      • <Possible follow-ups>
      • OBD - Mon, 17 Jun 2002 16:35:38 -0400 (EDT)

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-2011 All Rights Reserved.