xsl-list
[Top] [All Lists]

RE: xsl search engine

2004-03-10 09:26:04
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(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]De la part de
Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com
Envoyé : mercredi 10 mars 2004 13:07
À : xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Objet : RE: [xsl] 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



<Prev in Thread] Current Thread [Next in Thread>