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

Using contains() with for-each

Subject: Using contains() with for-each
From: "Grant, Kathryn --- Sr. Technical Writer --- WGO" <Kathryn.Grant@xxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jul 2005 15:06:45 -0700
using contains
Hello,

I'm working with this XML (simplified):

<keyrec>
	<keyword>APT1</keyword>
	<desc>Appt: Setup:</desc>
	<keywd_type>X B</keywd_type>
</keyrec>
<keyrec>
	<keyword>APT2</keyword>
	<desc>Appt: Confirm</desc>
	<keywd_type>B</keywd_type>
</keyrec>


<keywd_type> may contain the letters B, R, X, any combination of the
three (separated by spaces), or nothing at all.

My (working) XSL contains the following:

    <xsl:for-each select="//keywordtable/keyrec[keywd_type='B']">

Now I need to alter it so it's looking for records that *contain* B
rather than equaling B. So I tried this:

    <xsl:for-each select="//keywordtable/keyrec[contains('B',
keywd_type)]">

But this brings up records that contain *only B* or *nothing at all*.

What am I doing wrong?

Thanks in advance!

Kathryn


*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************

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.