[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Eliminating duplicate search results


Subject: Re: [xsl] Eliminating duplicate search results
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Sun, 10 Feb 2008 18:43:09 +0100

Kafai Publishing wrote:

<xsl:for-each select="strofen/regel">
<xsl:variable name="line" select="."/>
<xsl:variable name="linelow"
select="translate($line,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>


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

It looks to me as if you could simply replace the xsl:for-each with
<xsl:if test="strofen/regel[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), $querylow)]">
<xsl:value-of select="titel"/>
<br/>
</xsl:if>
That checks if there is a regel child element of the strofen element that contains the $querylow value and then outputs the titel value.


--

	Martin Honnen
	http://JavaScript.FAQTs.com/


Current Thread