xsl-list
[Top] [All Lists]

RE: grouping list items by attribute

2005-10-04 00:03:57
You can find an XSLT 2.0 solution to this problem (or one that is very
similar) in section 3.2 of

http://www.idealliance.org/proceedings/xml04/papers/111/mhk-paper.html

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: Lynn Alford [mailto:lynn(_dot_)alford(_at_)jcu(_dot_)edu(_dot_)au] 
Sent: 03 October 2005 23:59
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] grouping list items by attribute

Given this as the input

<tx.list style="ID1c6">
           <tx.li level="0" number="1.   ">
             <tx.p style="ID1a2">List1</tx.p>
           </tx.li>
           <tx.li level="0" number="2.   ">
             <tx.p style="ID1a2">List2</tx.p>
           </tx.li>
           <tx.li level="1" number=".    ">
             <tx.p style="ID1a2">Sublist 1</tx.p>
           </tx.li>
           <tx.li level="1" number=".    ">
             <tx.p style="ID1a2">Sublist 2</tx.p>
           </tx.li>
           <tx.li level="1" number=".    ">
             <tx.p style="ID1a2">Sublist 3</tx.p>
           </tx.li>
           <tx.li level="0" number="3.   ">
             <tx.p style="ID1a2">List3</tx.p>
           </tx.li>
         </tx.list>

The preferred outcome would be

<ol>
           <li>List1</li>
           <li>List2</li>
           <ul>
                   <li>Sublist 1</li>
             <li>Sublist 2</li>
             <li>Sublist 3</li>
           </ul>
           <li>List3</li>
         </ol>

My basic problem is I can't quite figure out how you can use 
an increase in 
level to trigger the start of a new list.  Especially when 
the lists may be 
nested much deeper and any level may be either ordered or unordered 
lists.  Siblings at the same level I can do easily enough.

Lynn

Lynn Alford                             Tel     (07) 47 81 6256
ITR                                             Email:  
imla(_at_)jcu(_dot_)edu(_dot_)au
JCU QLD 4811 Australia                  ICQ: 64096907
MSN: nicarra60(_at_)hotmail(_dot_)com              Y!: nicarra60

'I think an "uncatched exception" deserves three bug reports: 
one for the
exception, one for not catching it, and one for abuse of the English
language.'  Michael Kay





--~------------------------------------------------------------------
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>
--~--





--~------------------------------------------------------------------
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>