[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: Wed, 10 Mar 2004 14:07:18 +0200
xsl tokenizer
Hi,

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

If you have problems understanding what xsl:apply-templates does, you really need to go back to the spec or a book...
 
> How do I call the tokenizer template ?

  <xsl:call-template name="tokenizer" />

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

Template just defines the processing to be carried out when a node that matches the match pattern is processed. Which nodes are processed is defined by the select expression in xsl:apply-templates. So, if you call

  <xsl:apply-templates select="THEME"/>

every THEME child of the current node will be processed, but if you have

  <xsl:apply-templates select="THEME[contains(@label,substring-before($text, ' '))]"/>

those THEME children of the current node whose label attribute contain the substring that comes before the first SPACE character in $text.

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

I don't remember what your source looked like. Basically, where you want to process the matching THEME elements, instead of

   <xsl:for-each select="THEME[predicate]">

just call the tokenizer template.

> 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 :(

If this doesn't work, could you resend your test source, stylesheet so far and the expect output.

Cheers,

Jarno - Grendel: Pax Psychosis (Tactical Sekt remix)

 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.