Re: [xsl] Finding and comparing a parent attribute for the next result in a for-each loop

Subject: Re: [xsl] Finding and comparing a parent attribute for the next result in a for-each loop
From: Kate Busch Petersen <kate.busch-petersen@xxxxxxxxxxxxx>
Date: Fri, 08 Aug 2008 09:00:34 +0100
At 06:10 08/08/2008, you wrote:
Can you post the HTML you want to create from that fragment above?

--

        Martin Honnen
        http://JavaScript.FAQTs.com/

------------------------------

Date: Thu, 7 Aug 2008 17:41:28 +0100
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Subject: RE: [xsl] Finding and comparing a parent attribute for the next result in a for-each loop
Message-ID: <213750C294654BE1BBFBB903B53D7EDF@Sealion>


It looks to me as if this is more of a grouping problem than a sorting
problem.

If you are really stuck with XSLT 1.0 then you need to learn about Muenchian
grouping (http://www.jenitennison.com/xslt/grouping).

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


The HTML I want to produce for this part is a simple list of all the years:

<li>
<a href="index.asp?pageid=60&amp;section=articles&amp;subsection=section1&amp;thisyear=2008">2008</a>
</li>
<li>
<a href="index.asp?pageid=60&amp;section=articles&amp;subsection=section1&amp;thisyear=2007">2007</a>
</li>


And so on....

I've built the first two levels of navigation (sorting by section and displaying subsections), the html for that looks like:

<h2 class="title">Section selected</h2>
<ul class="tabs">
<li>
<a href="index.asp?pageid=60&amp;section=articles" >All</a>
</li>
<li>
<a href="index.asp?pageid=60&amp;section=articles&amp;subsection=section1">Section 1</a>
</li>
</ul>
<ul class="tabs_sub">
<li>
<a href="index.asp?pageid=60&amp;section=articles&amp;subsection=section1">Latest</a>
</li>
</ul>


Now I need to pop the years after the "latest" tab.


I have had a look at Muenchian grouping, but my problem is grabbing and sorting (or grouping) by the attribute from the parent element. I'll have another look though.



Kate Busch-Petersen


Current Thread