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

RE: Eliminating duplicate search results

Subject: RE: Eliminating duplicate search results
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 10 Feb 2008 21:55:27 -0000
RE:  Eliminating duplicate search results
> . 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).

I think that's exactly what your query does; but it doesn't seem to be what
you really want.
> 
> This, I succeed in, using this XSL:
> 
> ------------------------------------------------------------
> <xsl:for-each select="strofen/regel">
>  <xsl:variable name="line" select="."/>
>  <xsl:variable name="linelow"
> select="translate($line,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefgh
> ijklmnopqrstuvwxyz')"/>
>   <xsl:if test="contains($linelow,$querylow)">
>    <xsl:copy-of select="../../titel" />
>    <br />
>   </xsl:if>
> </xsl:for-each>
> ------------------------------------------------------------
> 
> . However, this returns 1 title for each line containing the 
> query. 

It looks as if your real requirement is

<xsl:if test="strofen/regel/line[contains(lower-case(.), $querylow]">
  <xsl:value-of select="titel"/>
</xsl:if>

(where you can replace lower-case() by your translate call if you are using
XSLT 1.0)

Michael Kay
http://www.saxonica.com/

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.