[xsl] xsl search engine

Subject: [xsl] xsl search engine
From: "Ricaud Matthieu" <matthieu.ricaud@xxxxxxx>
Date: Tue, 9 Mar 2004 12:16:06 +0100
Hello !

I have made a kind of search engine with asp and xsl. It actually search a
string in an XML document.
The XML document looks like this :
<LIST>
	<THEME label="blablabla">
	<THEME label="blillihblai">
	<THEME label="bloblobnlo">
	<THEME label="blublublulub">
</LIST>

The search engine only search on the labels attribute of the THEME nodes of
this xml document. I only need this for the moment.
To do it I use an HTML form in which the user write a string to search. Then
an asp page get this string and send it to the xsl as parameter. The xsl
then only matches the THEME nodes which contains the given string in his
label attributes :

<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 ?
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 ?

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 ?


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


Current Thread