logo       

Re: Problem with intersect: msg#00177

text.xml.exist

Subject: Re: Problem with intersect

Hi,

> /PLAY/PERSONAE/TITLE[contains(.,'Dramatis')] or
> /PLAY/ACT/TITLE[contains(.,'Act I')] and it returns 185 hits. And if I
> try /PLAY/PERSONAE/TITLE[contains(.,'Dramatis')] intersect
> /PLAY/ACT/TITLE[contains(.,'Act I')] I get 0 hits. But when I view
> individual files in /db/Shakespeare/play, I did find atleast 2 files
> that satisfied this condition. Can someone explain why intersect does
> not work in this kind of queries? Is there anything wrong in the syntax
> that I have used to query?

/PLAY/PERSONAE/TITLE selects the title elements below
PERSONAE, /PLAY/ACT/TITLE those below ACT. These are different node sets and
the intersection of both node sets is indeed empty. For the query to work,
you have to do the intersection on a common node, e.g.:

/PLAY[PERSONAE/TITLE[contains(., 'Dramatis')]]
intersect
/PLAY[ACT/TITLE[contains., 'Act I')]]

Wolfgang


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise