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

RE: Matching on of many string literal values using XP

Subject: RE: Matching on of many string literal values using XPath
From: Richard Rowell <richard@xxxxxxxxxxxxxxxxx>
Date: 13 Sep 2002 08:53:16 -0500
matching values using xpath
On Fri, 2002-09-13 at 03:38, TSchutzerWeissmann@xxxxxxxxxxxxxxxx wrote:
> 
> you could make a variable that concatenates all the different 
> values you'd like to test for and use contains() to do the 
> test.
> ie 
> 	<xsl:variable name="raceList">
> 		<xsl:text>white|black|asian|hispanic</text>
> 	</xsl:variable>
> 
> 	and 
> 
> 	<xsl:template match="client/race[contains($raceList,.)]
> 		 |
>  	agencies/race_served[contains($raceList,.)]">

I could but that will not behave exactly like I would like for every
possible input.  I can get the exact results I desire with a pair of
for-each loops and a variable containing a node set, but I was hoping
for something "clean".  It looks like nearly the exact same question was
asked here:

http://www.biglist.com/cgi-bin/wilma/wilma_hiliter/xsl-list/200006/msg00561.html

And Micheal Kay answered with a reference to his book:

http://www.biglist.com/cgi-bin/wilma/wilma_hiliter/xsl-list/200006/msg00569.html

My copy of the book is the second edition as where I believe by the date
of the message he was referring to the first.  Anyone know where I can
find said example in the new edition or know of a more elegant solution
then using contains() on a concatenated list or the brute force for-each
method?


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.