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

Re: Combining xsl:keys

Subject: Re: Combining xsl:keys
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Sat, 22 Jan 2005 10:29:16 +0100
xsl key map
Tempore 22:28:52, die 01/21/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit David Laurie <dlaurie@xxxxxxxxxxx>:

Hello all,

I read a post in the FAQ regarding getting a key to perform two different
functions by assigning the same key name two different uses
(http://www.dpawson.co.uk/xsl/sect2/N4852.html#d5690e700).

I have tried to make this work for the following problem without success: I
have a template creating and alphabetic list of titles following the
Meunschian sorting method (and some coding advice form this list -- Thx!!). I
now want to remove any duplicates from this list. My attempts involving t a
second key function produce a null set. (I have also tried the more
straightforward selection of title(not[.=preceding::title]) without success.
Hi,

I don't see any duplicates in your xml, maybe its just a small part of the real xml? Or do you consider the 'Climate in Alberta' series as duplicates?
I'll assume you mean with duplicates "maptitles that are stringwise indentical".



With tke keys:
<xsl:key name="maps" match="part/chapters/mapunits/maps/maptitle" use="substring(., 1, 1)"/>
<xsl:key name="maps" match="part/chapters/mapunits/maps/maptitle" use="."/>


...
<xsl:for-each select="key('maps', $firstletter)[generate-id(.) = generate-id(key('maps', .)[1])]">
<xsl:sort/>
<div class="mapTitle">
<a>
<xsl:value-of select="."/>
</a>
</div>
</xsl:for-each>
...



using the 'preceding' axis:


<xsl:value-of select="self::maptitle[not(.=preceding::maptitle)]"/>


regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Veni, vidi, wiki (http://www.wikipedia.org)

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.