[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: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 9 Mar 2004 14:55:48 +0200
xsl ignorecase

> <xsl:param name="string"/>
> <xsl:template match="LIST">
> 	<xsl:for-each select="THEME[contains(@label,$string)]">
> 		<xsl:value-of select="@label"/><br/>
> 	<xsl:for-each/>
> </xsl:template>
> So the problem is that this engine is not really performant : 
> if as user i
> search "Bla" it won't find it because of the case "B" instead 
> of "b". Is it
> possible to say IgnoreCase in xsl ?

No, you have to use an extension or use translate($text, 'ABCDEFG...', 'abcdefg...').

> The other (bigger) problem is that if the user write many 
> words (with spaces
> in between) "bla blo", the it will looks for this exact 
> string whereas i'd
> like it to search for bla OR blo. Is there a way to make it in xsl ? a
> special function ?

A recursive template. Tokenize the query string, and test each token individually.
> PS : in my project, i generate the whole Path
> "THEME[contains(@label,$string)]" with asp and this is the 
> string parameter
> i send to the xsl and then i do : <xsl:for-each
> select="dyn:evaluate(.,$string)"> (evaluate is a function from the dyn
> namespace which calculate the xPath expression. Maybe i could make an
> traitment direct in the aps page to do what i want ?

Umm... why don't you just use the expression THEME[contains(@label,$string)] and pass query string in with $string? I must be missing something here; wish I could say "Well, I am psychic, you know" like she can.


Jarno - Bruderschaft: Forever (Darkness Pulls Me Under Remix by State of the Union)

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

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.