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

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

Subject: Re: 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
Re:  marking up text when term from other file is found
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

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.