[xsl] sort problem second attempt

Subject: [xsl] sort problem second attempt
From: DPawson@xxxxxxxxxxx
Date: Fri, 26 Oct 2001 11:26:03 +0100
Hopefully slightly clearer

xml.

<doc>
 <r id="a1">
  <m245>
   <ttl>rec1</ttl></m245>
  <m655>
   <cat>narrow</cat>
   <term1>A little less narrow</term1>
   <term2>broad</term2>
  </m655>
 </r>

 <r id="a2">
  <m245>
   <ttl>rec2</ttl></m245>
  <m655>
   <cat>narrow</cat>
   <term1>less narrow</term1>
   <term2>broad</term2>
  </m655>
 </r>

 <r id="a3">
  <m245>
   <ttl>rec3</ttl></m245>
  <m655>
   <cat>narrow</cat>
   <term1>less narrow</term1>
   <term2>broadish</term2>
   <term3>broad</term3>
  </m655>
 </r>

 <r id="a4">
  <m245>
   <ttl>rec4</ttl></m245>
  <m655>
   <cat>narrow</cat>
   <term1>less narrow</term1>
   <term2>broadish</term2>
   <term3>absolutely wide</term3>
  </m655>
 </r>
</doc>

Requirement is to sort, such that new ordering is

rec 4 (alpha sort on highest termX) gives absolutely wide
    (recs 1,2 and 3 are 'equal' on this first sort)
rec 1 and rec2 are 'equal' at the next level (termX is 'broad')

next sort should give

rec 1, rec 2, rec3 since comparison is 
         'A little less narrow'
          'less narrow'
          'broadish'

so the required final order is

rec4, rec1, rec2, rec3.

Regards DaveP





************snip here************** 

- 

NOTICE: The information contained in this email and any attachments is 
confidential and may be legally privileged. If you are not the 
intended recipient you are hereby notified that you must not use, 
disclose, distribute, copy, print or rely on this email's content. If 
you are not the intended recipient, please notify the sender 
immediately and then delete the email and any attachments from your 
system.

RNIB has made strenuous efforts to ensure that emails and any 
attachments generated by its staff are free from viruses. However, it 
cannot accept any responsibility for any viruses which are 
transmitted. We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email 
and any attachments are those of the author and do not necessarily 
represent those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk 


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


Current Thread