Re: [xsl] Matching for strings...

Subject: Re: [xsl] Matching for strings...
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 06 Sep 2006 13:22:38 -0400
Bob,

Was it someone else who asked something very closely analogous to this just a week or two ago?

In any case,

At 11:35 AM 9/6/2006, you wrote:
I want to find <program> elements whose <title> or <subtitle> or
<description> might contain the string I've stowed in the variable
$target. Something simple like

<xsl:if test="matches(normalize-space(//tv:program),$target)">

fails, since the first argument wants to be a node, not a sequence.

Right. When they try this sort of thing people generally want


<xsl:if test="//tv:program[matches(normalize-space(),$target]">

which tests true if such a node exists.

An optimized processor, I assume, will return true as soon as it finds one such node. A naive one will examine all of them before returning true.

Cheers,
Wendell

Current Thread