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

Re: Search highlighting using xslt 2.0

Subject: Re: Search highlighting using xslt 2.0
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 24 Mar 2004 14:10:26 GMT
david overbosch
> This seems quite a task

yes but feasible in this case because you are matching well formed
fragments.
It gets much harder if you want need to break open arbitrarily nested
elements to mark your matched terms.
For example given your input


<p>This car has <b>170</b>bhp.</p>


you indicated you wanted "170bhp" to succeed and match the entire
original matched text in a highight element.

do you want a search of 70bhp to also succeed? If so, not only do you
have a harder job finding it you have a harder job highlighting as you
have to split the existing <b> element in two:

<p>This car has <b>1</b><highlight><b>70</b>bhp</highlight>.</p>

In general, you may have to unwind an arbitrary stack of nested elements
which can get entertaining in the case of tables for example:
is
<tr><td>170</td><td>bhp</td?</tr>
also supposed to match, here you can't put a single <highlight> around
the string as it would wreck the column structure, you have to mark up
each bit separately.

Depending on the answers, possibly completely different methods would be
needed, it's hard to "extend" a method just doing the simple case to
cover the later cases.

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.