|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Muenchian keys ... plus a bit?
Hi Dave,
> Question, how to remove the duplicate entries without losing
> the page numbers associated with the duplicate?
I assume that you have a key that indexes the ent elements by the
first letter of their item child:
<xsl:key name="entries-by-letter" match="ent" use="item" />
and that you use this to get all the entries that start with a
particular letter:
key('entries-by-letter', $letter)
If you also create a key that indexes the ent elements by the value of
the item:
<xsl:key name="entries" match="ent" use="item" />
then you can find a list of the unique terms for a particular letter
by searching through the set of entries returned by the
entries-by-letter key and pulling the Muenchian trick on them:
key('entries-by-letter', $letter)
[count(.|key('entries', item)[1]) = 1]
So you create one entry in your index for each of the terms. When it
comes to finding the list of page numbers, you need to use the entries
key again:
key('entries', $term)/pge
I hope that's enough to get you to a solution,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








