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

Re: Multiple Sort Key Components

Subject: Re: Multiple Sort Key Components
From: "Don Smith dsmith_lockesmith@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Jun 2019 11:59:21 -0000
Re:  Multiple Sort Key Components
Thank you, Michael.B 

Sent from Yahoo Mail on Android

  On Wed, Jun 5, 2019 at 3:27 AM, Michael Kay
mike@xxxxxxxxxxxx<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:   Your first
sort key is position(). Every item in the input has a different value for
position(). The Nth sort key only affects the outcome if all sort keys before
the Nth have duplicate values. When there are no duplicates for the first sort
key, the second and third will therefore have no effect.
Michael KaySaxonica


On 5 Jun 2019, at 00:28, Don Smith dsmith_lockesmith@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello,
I'm attempting to sort the content of a variable using multiple sort key
components and my last component (@range_length) doesn't take effect. Given
this input which reflects paragraphs in document order:
B <list_of_group_ranges>
B B B B B B B B B B B B B B B B B B B B B B B  <range comment_id="2"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
start_element="d34e70"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
end_element="d34e141"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
range_length="10"/>
B B B B B B B B B B B B B B B B B B B B B B B  <range comment_id="3"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
start_element="d34e70"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
end_element="d34e160"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
range_length="14"/>
B B B B B B B B B B B B B B B B B B B B B B B  <range comment_id="4"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
start_element="d34e70"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
end_element="d34e102"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
range_length="5"/>
B B B B B B B B B B B B B B B B B B B B B B B  <range comment_id="17"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
start_element="d34e174"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
end_element="d34e214"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
range_length="26"/>
B B B B B B B B B B B B B B B B B B B B B B B  <range comment_id="18"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
start_element="d34e174"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
end_element="d34e193"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
range_length="22"/>
B B B B B B B B B B B B B B B B B B B B B B B  <range comment_id="23"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
start_element="d34e203"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
end_element="d34e209"
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
range_length="25"/>
</list_of_group_ranges>
I want to sort these according to 3 sort components:1. document order2.
@start_element value3. @range_length value
The code I'm using to sort is:
B B B B B B B B B B B B B B B B B B B B B B  <xsl:for-each
select="$list_of_group_ranges/*">B B B B 
B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:sort
select="position()"/>
B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:sort
select="@start_element"/>
B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:sort
data-type="number" order="descending"B 
select="@range_length"></xsl:sort>B B B B B B B B B B B B B B B B B B B B B B
 B B B B 
B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:copy-of
select="."/>
B B B B B B B B B B B B B B B B B B B B B B B  </xsl:for-each>
But the last sort component, @range_length, isn't taking effect as the <range>
elements with the same @start_element don't sort according to @range_length.
What am I missing?
Thanks
Don
XSL-List info and archiveEasyUnsubscribe(by email)

XSL-List info and archiveEasyUnsubscribe(by email)

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.