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]

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



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

  I guess I thought this was a useful XPath match to send along

ouch:-)

record[data_field/*= 	contains(., '21 (')



contains(., '21 (') will be true or false if the string '21 ('
appears in the string value of record (ie anywhere in the concatenation
of any of the children of record, not just in data_field children)
or you could have '2' in one child, and '1 (' in the next.

data_field/* is a node set valued expression that will be converted to a
boolean as it is used in a boolean context, it is true if the record
element has a data_field child that has a child. (I suspect that this is
always true for your example).
so the = will be true if they are both true or both false, but seing as
the lefthand side is always true, it is true if the substring '21 ('
appears anywhere in the string value. Similarly the other half of the
expression tests for '0141-6200' so I think that your test is
equivalent to
record[contains(., '21 (') and contains(., '0141-6200')]

David


 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]