[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Matching for strings...

Subject: Re: Matching for strings...
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 06 Sep 2006 13:22:38 -0400
Re:  Matching for strings...
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

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.