xsl-list
[Top] [All Lists]

grouping/sorting on delimited field

2005-07-19 11:19:10
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 
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • grouping/sorting on delimited field, Nathan Shaw <=