This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Check a node in my XML contains a particular value!
- From: "Simpson, George" <GeorgeS at Petrotechnics dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 13 May 2002 14:16:13 +0100
- Subject: [xsl] Check a node in my XML contains a particular value!
- Reply-to: xsl-list at lists dot mulberrytech dot com
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