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

Re: Muenchian keys ... plus a bit?

Subject: Re: Muenchian keys ... plus a bit?
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 10:45:54 +0100
keys plus
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 Tennison

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

Current Thread


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.
First Name
Last Name
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.