[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 17:26:04 +0100
xsl tokenizer
Ok I understood what I didn't understood before, I'm trying to make it good
and I write back either the solution I found or maybe other problems I
encountered
indeed I encountered other problems :
- In the recursive template, there's a problem at the last loop cause
substring-before the space is empty, but I found a solution
- there's also the problem of double matched THEME, because they have many
correspondings strings in label attribute
- How to highlight the searched string while displaying the label attribute
of the THEME elements matched.

So I'm working on it (it's about to be over) and come back in a while...

-----Message d'origine-----
De : owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]De la part de
Jarno.Elovirta@xxxxxxxxx
Envoyé : mercredi 10 mars 2004 13:07
À : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : RE:  xsl search engine


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


 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.