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

grouping/sorting on delimited field

Subject: grouping/sorting on delimited field
From: Nathan Shaw <n8shaw@xxxxxxxxx>
Date: Tue, 19 Jul 2005 11:19:10 -0700 (PDT)
sort delimiter
Hi all. I am a digester, so I would appreciate a
direct reply along with your reply to the list.
 
I have XML that looks like this:
 
<dataroot
xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2005-06-07T15:27:42">
  <HQPayloads>
    <MotherPayload>ADF</MotherPayload>
    <PayloadTitle>Avian Development Biology
Experiment</PayloadTitle>
    <Increment>|4|</Increment>
  </HQPayloads>
  <HQPayloads>
    <MotherPayload>ADUM</MotherPayload>
    <PayloadTitle>Advanced Diagnostic Ultrasound in
Microgravity</PayloadTitle>
    <Increment>|8||9||10||11|</Increment>
  </HQPayloads>
  <HQPayloads>
      <MotherPayload>AFEL</MotherPayload>
      <PayloadTitle>Advanced Flight Engineering
Lab</PayloadTitle>
      <Increment>|3|6||8|</Increment>
  </HQPayloads>
</dataroot> 
 
and I need to sort and group on the <Increment>
element so that I end up with something like this:
 
<p>Increment 1<br/>
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)
</p>
 
<p>Increment 2<br/>
  <PayloadTitle> (<MotherPayload>)
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)
</p>
 
<p>Increment 3<br/>
  <PayloadTitle> (<MotherPayload>)
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)
</p>
 
<p>Increment 4<br/>
  <PayloadTitle> (<MotherPayload>)
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)<br/>
  <PayloadTitle> (<MotherPayload>)
</p>
 
I am using XSLT 1, Saxon and am trying to avoid
extension functions (one option would be to use
Saxon's range function and loop from 1 to 11, using
contains()).
 
Any ideas/help is appreciated! I have never had to
sort/group on a delimited field before.
 
--Nate


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 

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.