From: Michael B. <mbe...@mb...> - 2006-02-07 21:55:14
|
Scott Gillespie wrote: > collection('/db/valley/newspapers')/hwp/paperBody/page//*[ text() &= > "gillespie"] [...] > > The above xquery returns only nodes with gillespie in them. OK, so that's your original question dealt with, at least. > > Then this one: > > for $entries in collection('/db/valley/newspapers')/hwp[./header/date/@n > > "1859-01-01" > and ./header/date/@n < "1860-12-31"]/paperBody/page//*[ text() &= > "gillespie"] [...] Which looks as though we may be straying into the still-troubled area of multiple predicate evaluation in eXist, which it outside my scope. But let's see if we can get closer to what is going on than just saying that "all sorts of nodes" are returned. What happens if you leave off the second part and make that collection('/db/valley/newspapers')/hwp[header/date/@n > "1859-01-01" and header/date/@n < "1860-12-31"] Note that I have deleted your ./ since I get anxious about redundant syntax. If what you meant can be expressed by the simple element name here, then your original syntax was probably trying to say something other than what I have "translated" it into. Does that return the correct nodes (i.e. only those hwp nodes and their descendants that match the value range for the n attribute value on the date elements?) If not, try helping the parser by using parentheseis to group the sub expressions (so much for my objections to redundant sytax!) like so: collection('/db/valley/newspapers')/hwp[(header/date/@n > "1859-01-01") and (header/date/@n < "1860-12-31")] If one or both of those return the specified nodes correctly, but restoring the rest of the expression reverts to nonsense, then you have probably discovered another bug in the predicate evaluation optimiser. (I take it that you are using the latest snapshot...) In which case I have to sit out the rest of this little dance... To eliminate other possible (if unlikely) sources of processing error, I suggest you try these XPaths via the Java client rather than within complete XQueries. Michael Beddow |