Hi Xavier,

A refentry cannot contain another refentry. The refentry content model is 
similar to
http://www.docbook.org/tdg5/en/html/refentry.html
except that in my documents, the relatedlinks element is an optional child of 
refentry that occurs as the last child (if it occurs at all).

In trying to reproduce the behavior with a small XML file that I might be able 
to send you, I noticed a few things:
a) All the incorrect results I see are in one particular XML file in my query 
library. When I reimported that file into the query library (either using the 
Import Documents dialog in Qizx Studio 4.2 or using my Java program that uses 
the Qizx API), the query results were correct.
b) When I built a new query library but only for a few of my XML files, 
including the one I mentioned in (a), the query results were correct.

Sorry if these observations don't help you reproduce the problem. I'll let you 
know if I am able to send a sample file that reliably reproduces the problem.

Regards,
Amanda


> -----Original Message-----
> From: Xavier Franc [mailto:[email protected]]
> Sent: Monday, January 09, 2012 3:36 PM
> To: [email protected]; Amanda Galtman
> Subject: Re: [Qizx] Incorrect result when using predicate expression
> 
> Hello Amanda,
> 
> indeed using // or descendant-or-self:: is unlikely to
> make any difference, because anyway relatedlinks is necessarily
> an actual descendant of refentry.
> 
> The bug comes probably from the compilation of the path-expression
>       //refentry[count(descendant-or-self::relatedlinks)=0]
> into basic indexed queries.
> 
> To help me understand what happens, it could be useful
> to have an idea of the structure of your data, like for
> example to know whether a refentry can contain another refentry.
> The best would be to provide us a sample.
> 
> best
> 
> 
> --
> Xavier Franc
> Qizx design and development
> 
> 
> On Mon, 09 Jan 2012 14:33:31 +0100, Amanda Galtman
> <[email protected]> wrote:
> 
> > [Forwarding to list.]
> >
> >> -----Original Message-----
> >> From: Amanda Galtman
> >> Sent: Monday, January 09, 2012 8:31 AM
> >> To: 'Olivier JEULIN'
> >> Subject: RE: [Qizx] Incorrect result when using predicate expression
> >>
> >> Hi Olivier,
> >>
> >> Thank you for the quick reply, and the correction and suggestion. I
> >> tried the following
> >> and still get "1"s among the results, in versions 4.2 and 4.4.
> >>
> >> Query #1
> >> for $node in //refentry[count(descendant-or-self::relatedlinks)=0]
> >> return (count($node//relatedlinks))
> >>
> >> Query #2
> >> for $node in //refentry[count(.//relatedlinks)=0]
> >> return (count($node//relatedlinks))
> >>
> >> Query #3
> >> for $node in //refentry[count(descendant-or-self::relatedlinks)=0]
> >> return (count($node/descendant-or-self::relatedlinks))
> >>
> >> (The results are the same across all three queries and two versions.)
> >>
> >> Thank you,
> >> Amanda
> >>
> >>
> >>
> >> > -----Original Message-----
> >> > From: Olivier JEULIN [mailto:[email protected]]
> >> > Sent: Monday, January 09, 2012 7:31 AM
> >> > To: Amanda Galtman
> >> > Subject: Re: [Qizx] Incorrect result when using predicate expression
> >> >
> >> > Le 08/01/2012 13:36, Amanda Galtman a écrit :
> >> >
> >> >  Hi,
> >> >
> >> >  I believe the following query should not produce any "1"s in the
> >> result.
> >> > However, it produces a small number of "1"s along with the many
> >> correct "0"s.
> >> >
> >> >  for $node in //refentry[count(descendant::relatedlinks)=0]
> >> >  return (count($node//relatedlinks))
> >> >
> >> >  I first saw a problem like this in Qizx Studio 4.2. I tried the same
> >> thing in Qizx
> >> > Studio 4.4, with the same result.
> >> >
> >> >  I tried this variation, and it produced the expected result of all
> >> "0"s.
> >> >
> >> >  for $node in //refentry
> >> >  where (count($node//relatedlinks)=0)
> >> >  return (count($node//relatedlinks))
> >> >
> >> >
> >> >
> >> > Your queries are different: // is a synonym for descendant-or-self
> >> > Try the first query with "descendant-or-self::relatedlinks" (or
> >> ".//relatedlinks")
> >> instead
> >> > of "descendant::relatedlinks", if there still are "1", this is a bug.
> >> >
> >> >
> >> > --
> >> >
> >> >
> >> > Olivier JEULIN
> >> > Chef de projet
> >> > [email protected]
> >> > Tél: +33 (0)1 41 05 22 00
> >> >
> >> >
> >> >
> >> > 42, rue de Villiers
> >> > 92532 Levallois cedex
> >> > www.efl.fr
> >
> > --
> > Qizx Support List
> > [email protected]
> > http://www.xmlmind.com/mailman/listinfo/qizx-support
 
--
Qizx Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/qizx-support

Reply via email to