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

RE: xsl search engine

Subject: RE: xsl search engine
From: "Ricaud Matthieu" <matthieu.ricaud@xxxxxxx>
Date: Tue, 16 Mar 2004 16:06:21 +0100
xsl search
10, 15min !!!! It makes me think I'm not really efficient at work ...(anyway
i'm not well paid:)
The engine works and that's really great.

When I have the time I'll try to perfect it, I didn't manage to get out of
the problem of Case and accents :
it's harder then just add translate($text, 'ABCDEFG...éèê', 'abcdef...eee')
on every contains() and most of all it's hard to get the result with the
original case at the end.

Other thing is that the @label contains twice the searched expression then
it will will be display once (that was a last problem) BUT it will highlight
only the first occurence...

For the moment I let it down, it's already good enough (unlessit's only a
few lines to change but it' doesn't seems to...)

By the way I also generelized the search engine templates in a common XSL
file which I can import from any XSL to search a string in any XML node.

In each template (tokenizer and highlight see previous messages) I had the
parameter "target" and changed every @label by $target. I can then call
thoses templates with 2 parameters :
 1) the expression to search with $string
 2) where to search with $target

In the XSL I then only have, for example :
		<xsl:for-each select="THEME">
				<xsl:variable name="match">
					<xsl:call-template name="tokenizer">
						<xsl:with-param name="string" select="'some expression the be
searched'"/>
						<xsl:with-param name="target" select="@intitule"/>
					</xsl:call-template>
				</xsl:variable>
				<xsl:if test="string($match)">
					<xsl:value-of select="@id"/> :
					<xsl:call-template name="highlight">
						<xsl:with-param name="string" select="'some expression the be
searched'"/>
						<xsl:with-param name="target" select="@intitule"/>
					</xsl:call-template>
				</xsl:if>
		</xsl:for-each>


-----Message d'origine-----
De : owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]De la part de
Jarno.Elovirta@xxxxxxxxx
Envoyé : vendredi 12 mars 2004 19:41
À : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : RE:  xsl search engine


Hi,

> How long did you need jarno to do all this code ?!!

I don't know, 10-15 minutes?

> Really, really thank you, it work very fine!
> Recursive Template are really powerfull, but I don't feel
> really at ease
> with them (it's quite logical when I see the solution, but I
> don't manage
> yet to create them myself)

Pick up a book about XSLT, they usually have a chapter about string
processing and how to use recursive templates in it.

> Till now I've never used extensions (does that mean own
> namespace ?)

No, extension elements and functions to XSLT and XPath that the
implementation provides.

Cheers,

Jarno

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.