xsl-list
[Top] [All Lists]

Re: Combining xsl:keys

2005-01-22 02:29:16
Tempore 22:28:52, die 01/21/2005 AD, hinc in xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit David Laurie <dlaurie(_at_)ualberta(_dot_)ca>:

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)

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