[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: expression value not a node set on content match
Subject: Re: expression value not a node set on content match From: John Robert Gardner <jrgardn@xxxxxxxxx> Date: Thu, 4 May 2000 12:34:56 -0400 (EDT) |
Sorry, but this still isn't getting it, and the "and" is repeated too . . see note below (I'm now getting unrecognized operator pointing to my "xsl:apply-templates line" from XT)" On Wed, 3 May 2000, Mike Brown wrote: > > 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. Okay, this make sense, so, per you below, I tried (b/c @x and @g are both attributes of the children of the element with @773 wherein the required text string on which to match is found: <xsl:template match="/"> <xsl:copy-of select="record[ @tag='773'/*[@code='g' contains(text(),'21 ') and *[ @code='x' and contains(text(),'0141-6400') ] ]" /> </xsl:template> Note: I've tried to replace copy-of with "apply-templates" wrapped in xsl:copy, and still problems . . . sorry, I am just not getting this, and the syntax for the Path is really screwing me up. jr > > 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  . > > - 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 > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: expression value not a node set, Mike Brown | Thread | Re: expression value not a node set, David Carlisle |
Re: Stripping carriage returns, Mike Brown | Date | Escaping for use in URLs, ed billings |
Month |