xsl-list
[Top] [All Lists]

[xsl] Grouping siblings according to attribute sequence

2011-04-08 17:02:23

Hi all,
I am using Saxonica\SaxonHE9.3N
I have the following source xml
      <terms>        <term level="1" termid="10" >         
 <value>ONE</value>        </term>        <term level="2" termid="8" >         
 <value>TWO</value>        </term>        <term level="3" termid="6" >         
 <value>THREE</value>        </term><!-- end of sequence = level number restart 
at 1 -->        <term level="1" termid="3" >          <value>ONE BIS</value>   
     </term>        <term level="2" termid="1" >          <value>TWO 
BIS</value>        </term>        <term level="3" termid="58" >         
 <value>THREE BIS</value>        </term>        <term level="3" termid="45" >   
       <value>THREE TER</value>        </term><!-- end of sequence = level 
number restart at 1 -->        <term level="1" termid="5" >          <value>ONE 
FOURTH</value>        </term>      </terms>
Sequence always start with level = 1term are in sequence levels that are always 
in increasing order, 1, 2, 3, etc.Last item in the sequence can be duplicated 
(more that twice) there can be up to 5 levels max
I would like to get the following :
      <terms>        <sequence>          <value>THREE/TWO/ONE</value>       
 </sequence>        <sequence>          <value>THREE BIS/TWO BIS/ONE 
BIS</value>        </sequence>        <sequence>          <value>THREE TER/TWO 
BIS/ONE BIS</value>        </sequence>        <sequence>          <value>ONE 
FOURTH</value>      </terms>

Thank you to help me get started.
Christian                                         
--~------------------------------------------------------------------
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>