This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Check a node in my XML contains a particular value!


Hi all,

At present I am using <xsl:when test="starts-with(wcc/wcc-category-oid, 'CSE')"> and my research comes back with the usage of <xsl:when test="contains(wcc/wcc-category-oid, 'CSE')">, but this only checks that both string values are identical (I think, correct me if I am wrong).

What I would like to do is check that the string value in my XML node contains a value :-

My working XML

<?xml version="1.0"?>
<report-root>
    <wcc has-lessons="true">
        <wcc-category-oid>CSE is what this is</wcc-category-oid>
    </wcc>
</report-root>

XSL

<xsl:when test="starts-with(wcc/wcc-category-oid, 'CSE')">

What I want

<?xml version="1.0"?>
<report-root>
    <wcc has-lessons="true">
        <wcc-category-oid>This is a CSE</wcc-category-oid>
    </wcc>
</report-root>

XSL

<?> How do I check to see if the value CSE is within the node?

Many thanks to all for any help.

Kind regards,

George

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]