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

Eliminating duplicate search results

Subject: Eliminating duplicate search results
From: "Kafai Publishing" <info@xxxxxxxx>
Date: Sun, 10 Feb 2008 17:20:00 +0100
 Eliminating duplicate search results

I am trying to search through XML containing poems. XML for one poem:

       <regel>omdat jij niet oplet</regel>
       <regel>doe ik het snel</regel>
       <regel>want als jij niet</regel>
       <regel>dan ik wel</regel>

. Now, for each occurrence of a search query value within an element <regel>
(line) I want to see the contents of the parent element <titel> (title).

This, I succeed in, using this XSL:

<xsl:for-each select="strofen/regel">
<xsl:variable name="line" select="."/>
<xsl:variable name="linelow"
 <xsl:if test="contains($linelow,$querylow)">
  <xsl:copy-of select="../../titel" />
  <br />

. However, this returns 1 title for each line containing the query. This
leads to multiple occurrences of the same title, as the query can be present
in multiple lines of 1 poem. As is visible in my output:


. Now. I have read this post:


which should, I think, solve my problem. But I cannot figure out how to
translate it into something that works in my situation.

I would greatly appreciate any and all help.

I am using XSL version 1 with the XSL1 processor in MSIE7.



Kafai Publishing
Michiel F.E. van Reenen
Minckelersweg 8-101
2031 EM Haarlem
t +31 (0) 630646049
f +31 (0) 847439591
KvK Amsterdam 34191142
"Brilliance is built on hard and methodical labour"


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.