xsl-list
[Top] [All Lists]

Using contains() with for-each

2005-07-26 15:06:45
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.
*******************************************************


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>