Re: [xsl] marking up text when term from other file is found

Subject: Re: [xsl] marking up text when term from other file is found
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Thu, 22 Apr 2010 18:22:50 +0530
On Thu, Apr 22, 2010 at 5:24 PM, Wolfgang Laun <wolfgang.laun@xxxxxxxxx>
wrote:
> C1: B The pattern containing all terms can be constructed once and not
> repeatedly within the template doing the analyze-string.

I agree. Thanks for the observation.

So, I propose following changes to the stylesheet:
1) Have a global variable as following,
  <xsl:variable name="term-regex" select="string-join(for $term in
$index-terms/terms/term
							                   return concat('(', $term, ')'), '|')" />

2) and change, the 'analyze-string' instruction to following,
<xsl:analyze-string select="."
	                     regex="{$term-regex}">
 ...

> C2: B The flags attribute of analyze-string should be used to do a case
> insensitive match: flags='i'

I agree :)


--
Regards,
Mukul Gandhi

Current Thread