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

Re: Finding Any Occurrance

Subject: Re: Finding Any Occurrance
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 01 Sep 2006 15:49:12 -0400
matcher.equals
Bob,

We need to know more....

At 01:31 PM 9/1/2006, you wrote:
I have (successfully!) pulled some content from an outside file (and
hidden it in the variable $matcher). I now want to look through my
input file to see if that content is in any <title> child, anywhere,
so I know if it's worth carrying on processing for this content. But

<xsl:if test="//title = $matcher">

doesn't work. What have I overlooked?

By "that content is in any title child, anywhere", do you mean the string value of $matcher equals the string value of any title? Your equality test should check that.


If you mean "the value of matcher is a substring of the value of any title anywhere", you'll have to be more creative:

if test="//title[contains(.,$matcher)]"

tests true if there exists any title node whose string value contains the string value of $matcher.

Remember that whitespace in your title values, or in $matcher, can throw this off too ... in which case the normalize-space() function comes to the rescue.

Ask again if this isn't enough to get you there.

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.