Re: expression value not a node set on content match

Subject: Re: expression value not a node set on content match
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 3 May 2000 16:59:32 -0600 (MDT)
> and I only want ot pull out those few <record>'s with given content in
> data-field[@tag='773']/subfield[@code='g'] --in other words a
> record with text string 0000-1234 in subfield[@code='g'] of
> data-field[@[tag='773'] ALONG WITH a test string of say "21 " (note the
> space- do I use &#?) in subfield[@code='x'] of same datafield[@tag='773']
> in that record, what gives?  I'm using 
>
> <xsl:apply-templates select="record[*[@tag='773']/*[@code='g'
> [contains(., '21 ')]] 
> and record[*[@tag='773']/*[@code='x'
> [contains(., '0141-6400')]]"/>

It is complaining because you are putting a predicate -- something, i.e.
contains(., 'foo'), in brackets -- after what is either a string object
('g') or a boolean object (@code='g'), but a predicate is something that
can only modify a node-set.

Try something like this (copious whitespace only here for clarity):

select="record[ @tag='773'
                and contains(.,'21 ')
                and *[ @code='x'
                       and contains(.,'0141-6400') ]
              ]"

As for the space in the 21, it doesn't matter if you use a literal
character or a numeric character reference. If it's a regular space just
type a regular space from your keyboard. If it's a non-breaking space you
can probably use a keyboard trick to produce that character (alt-0160 on
NT, for example), or you could use &#160;.

   - 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