[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Sibling text() Content Match [was: Re: expression value not a node set on content match]


Subject: Re: Sibling text() Content Match [was: Re: expression value not a node set on content match]
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 4 May 2000 13:40:01 -0600 (MDT)

>  select="record[data_field/*=
> 	contains(., '21 (') and ../*=contains(., '0141-6200')]" />

Hmm, interesting. This might work for your data set but I question it
because you're selecting records for which a very weird test is true.

Consider that contains() returns a boolean. A node-set
compared to a boolean will be true if:
 - the node-set is empty and the boolean is false; or
 - the node-set is not empty and the boolean is true.
Otherwise the comparison will be false and the record won't be selected.

Also, you're still using . instead of text() and thus might accidentally
be looking at all the text in the sub-elements instead of just the
immediate child text nodes for the record element. If one of the
substrings you're looking for can be found further down that branch of the
tree, you'll select the wrong node.

 [gratuitious quoting of previous messages in the thread deleted...]

   - Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/    http://www.webb.net/


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



Current Thread