Subject: Re: [xsl] Check a node in my XML contains a particular value! From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Mon, 13 May 2002 14:37:52 +0100 |
Hi George, > 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). The starts-with() function tests whether the value of the node that you select starts with a particular string; the contains() function tests whether the value of the node you select contains a particular string. If you want to test whether the string is identical to the node, then you'd use =. For example, starts-with('CSE is what this is', 'CSE') would be true, as would: contains('CSE is what this is', 'CSE') contains('This is a CSE', 'CSE') Is that not what you're getting? Perhaps you're testing the wrong path -- what's your context node at the point where you're doing the test? What node are you processing at that point? You need to make sure that the path is relative to that node, so for example if you're already on the wcc element, you need to do just: contains(wcc-category-oid, 'CSE') Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Check a node in my XML co, David Carlisle | Thread | RE: [xsl] Check a node in my XML co, Simpson, George |
Re: [xsl] Check a node in my XML co, David Carlisle | Date | RE: [xsl] Check a node in my XML co, Simpson, George |
Month |