[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Creating index using xsl

Subject: Creating index using xsl
From: "Kaarle Kaila" <kaarle.kaila@xxxxxx>
Date: Wed, 1 Oct 2003 22:38:04 +0300
creating index
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 http://www.kk-software.fi/kalle/xsl/koe.xml that
creates a simple
index of the data it contains by using
http://www.kk-software.fi/kalle/xsl/tables.xsl and
http://www.kk-software.fi/kalle/xsl/tables.css.

A transformed html file that contains also the table text
exists at http://www.kk-software.fi/kalle/xsl/table.html. 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-software.fi/kalle/xsl/resu1.html. At
http://www.kk-software.fi/kalle/xsl/resu2.html
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"/>
               <TR>
                    <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:apply-templates/>


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


                    </TD>
               </TR>
          </xsl:for-each>



--
Kaarle Kaila
email: kaarle dot kaila at iki dot fi
www.iki.fi/kaila


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.