[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: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 22 Apr 2010 13:29:48 +0100
Re:  marking up text when term from other file is found
On 22/04/2010 12:54, Wolfgang Laun wrote:
Two comments and two questions.

Q1:  XSLT patterns don't have the zero-length assertion \b available
to match a word boundary. This may result in unexpected matches. With
analyze-string it is not possible to apply the usual trick of adding
an extra character before and after the string. So how can an exact
match be done here?

You can pre-rocess the string to put in reliable separators (usually) there were some examples in a thread on this list a few weeks back.
But exactly what you need to do depends on what the answer is supposed to be if the input string looks like
......Sick children, illness...

as then case insensitive matches would lead to a requirement to use overlapping markup around .Sick children and children, illness

Or perhaps in real cases you know such overlaps don't matter (in which case you may also know you don't need to worry about word boundaries)

Q2: If the index or document is big, it might be faster to have xsl:key on the indexTerms. Is it possible to construct such a key with the matching string being the original<term/> content *in lowercase*?

not sure what you mean but <xsl:key match="something" use="lower-case(term)"/> might be the answer.

Can it be done by constructing a temporary tree and applying xsl:key
to that?

No an xsl:key always applies to all documents, so if you do need to construct a temporary document its use would be with key() rather than xsl:key


________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

Current Thread


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.
First Name
Last Name
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.