Subject: Re: [xsl] word search a document and eliminate duplicate results From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Sun, 09 Jan 2005 10:40:24 +0100 |
The search term ($target1) may appear within a <p>, within a <note>, or within a <p> that is within a <note>. If it occurs anywhere within a note, then I need not only the note but the paragraph in which it resides. Which further muddies the water because if a paragraph contains the search term and that same paragraph also contains a <note> that contains the search term, I still need to output that paragraph only once.
<xsl:template match="text()" mode="search"> <xsl:param name="term" select="''"/> <xsl:param name="element" select="''"/> <xsl:choose> <xsl:when test="contains(.,$term)"> <xsl:for-each select="ancestor::p[not(parent::note)][1]"> <xsl:apply-templates/> <hr/><br/> </xsl:for-each> </xsl:when> <xsl:otherwise/> </xsl:choose> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Vincit omnia simplicitas Keep it simple
Current Thread |
---|
<- Previous | Index | Next -> |
---|---|---|
[xsl] word search a document and el, Susan | Thread | Re: [xsl] word search a document an, Susan |
Re: [xsl] List of XSL-FO processors, Tokushige Kobayashi | Date | Re: [xsl] word search a document an, Susan |
Month |