RE: [xsl] Creating index using xsl

Subject: RE: [xsl] Creating index using xsl
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 1 Oct 2003 21:41:44 +0100
It sounds to me as if you are trying to do grouping: see for a guide on how to achieve

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Kaarle Kaila
> Sent: 01 October 2003 20:38
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Creating index using xsl
> hi,
> I am rather new to this list but I have tried to look for an 
> answer to my problem from the FAQ. At least it seems I cannot 
> use a variable in a for-each loop to compare with the previous value.
> I am looking into xslt to see how much I can use it to create 
> some genealogical reports and it seems that formatting of the 
> data might be ok and perhaps also creating teh indexes.
> I have a simple xml-file at 
> that creates a 
> simple index of the data it contains by using 
> and 
> http://www.kk->
> A 
> transformed html file 
> that contains also the table text exists at 
> http://www.kk-> The texsts 
> are in Finnish 
> but have no meaning. The index as it is created by the xsl is 
> transformed also at 
> http://www.kk-> At 
you can see how I would want teh index to look. Of course with real data
there would be more than 1 table but so far I have experimented only
with one table.

Sorting in finnish/swedish order seems to be no problem but how to
combine the current name element with the previous is. I have tried to
use variables, I have tried to get hold of previous-sibling but not
succeeded. Can anybody out there help me with this. Can I do what I want
with xslt?? Here is still a code-sniplet from the xsl-file:

       <xsl:for-each select="//name">
            <xsl:sort order="ascending" lang="fi" select="@sur"/>
            <xsl:sort order="ascending" lang="fi" select="@given"/>
                    <TD align="left">
<!-- here I should check if the name is equal to previous name
      if so then I would not create a new row but continue on previous

                         <xsl:value-of select="ancestor::table/@number"


Kaarle Kaila
email: kaarle dot kaila at iki dot fi

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread