Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Finding Any Occurrance

From: Wendell Piez <wapiez@---------------->
To:
Date: 9/1/2006 7:53:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent