[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: Wed, 10 Mar 2004 12:08:05 +0100
xsl tokenizer
Great advices Jarno ! Thanks again.

About generating the string with asp, you're right, it's quite more simple
to use xsl:chose,
why did i not thought about it !? (dummy me !)

But I still encounter problems using the recursive template... I search on
my own a good time cause I didn't want to bother you again (and I thought 'I
must be able to..'), but finally there 's really something I don't see.
I notice that I don't really understand the xsl:apply-template element with
a select attribute...

How do I call the tokenizer template ?
I was using a <xsl:for-each select="THEME[predicate]"> to display the
searched THEME.
With the tokenizer template, there is <xsl:apply-templates
select="THEME[predicate]/>
So I guess I should have a <xsl:template match="THEME"> anywhere, but then
it would match all THEME elements no ?
how to say the xslt processor it must match THEME with the perdicate
calculate in tokenizer template ?
...something like <xsl:for-each select="tokenizer?"> but it doesn't make
sens don't it ?

So my xsl look lyke this now :

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" indent="yes"/>
	<xsl:param name="String"/> <!-- string sent by the xslt processor -->

	<xsl:template name="tokenizer">
  		<xsl:param name="text" select="normalize-space($string)"/>
  		<xsl:if test="$text">
   			 <xsl:apply-templates
select="THEME[contains(@label,substring-before($text, ' '))]"/>
   			 <xsl:call-template name="tokenizer">
    				 <xsl:with-param name="text" select="substring-after($text, ' ')"/>
   			</xsl:call-template>
  		</xsl:if>
	</xsl:template>

	<xsl:template match="LIST">
		<form action="display.asp" method="POST">
			<input type="text" name="UserString"/>
			<input type="submit" value="Go!"/>
		</form>
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="THEME">
		<xsl:value-of select="@label"/><br/>
	</xsl:template>

</xsl:stylesheet>

But it display all the THEME elements as I said...
I'm sure there's a little thing I don't see and I will say "Off course !
that was it !" but right now I'm ...lost :(
In advance thanks for your Patience...

Matt



 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.