xsl-list
[Top] [All Lists]

Re: [xsl] Generating multi-level flexible recursive nested lists

2006-06-06 15:05:07
David,

Thanks for your prompt reply.

Input is the xml file and output will be html file. I
have just copied required part in the forum.

If you see HTML view of my expected output, you will
know what I meant.

<html>
<body>
        <ol>
                <li>
                  ALevel1
            </li>
                <li>
                  BLevel1
             </li>
                <ol>
                        <li>
                          aLevel2
                    </li>
                        <li>
                          bLevel2
                         </li>
                </ol>
                <li>
                  CLevel1
                </li>
                <li>
                  DLevel1
                 </li>
                <ol>
                        <li>
                          aLevel2
                        </li>
                        <li>
                          bLevel2
                         </li>
                        <ol>
                                <li>
                                  iLevel3
                                </li>
                                <li>
                                  iiLevel3
                                 </li>
                        </ol>
                        <li>
                          cLevel2
                         </li>
                </ol>
                <li>
                  ELevel1
                 </li>
        </ol>
</body>
</html>

I did try finding it on your website but couldn't find
it. Just to remind that input xml file can have more
sublevel e.g. level5, level6 and so on.

Thanks again.

Regards,

Dev

- David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:


Just to confirm,

BLevel1
</li>
<ol>
<li>
aLevel2

Is that really what you want, with the nested <ol>
being a sibling of
the li (rather than a child),more like

BLevel1
</li>
<ol>
<li>
aLevel2
</li>
..
</ol>
</li>

The first form isn't valid html, although of course
xslt doesn't care
about that and would generate whatevr you ask for.

This is a more or less standard example of "xslt
positional grouping" and
searching teh archives of this list for that should
lead you to the
right solution. (Like many grouping problems the
syntax is a bit clearer
in xslt2 if that is an option)

David


________________________________________________________________________
This e-mail has been scanned for all viruses by
Star. The
service is powered by MessageLabs. For more
information on a proactive
anti-virus service working around the clock, around
the globe, visit:
http://www.star.net.uk

________________________________________________________________________


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




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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>