From: Jean-Marc V. <jm...@fr...> - 2004-04-06 15:13:11
|
Were you able to reproduce the bug with a very small dataset ? Are there many XML levels between tags TEI.2 and letHeading ? Is there a hint in the log on server side on standard output that .// is treated differently from descendant:: ? Have you tried the XQuery way? let $streuvels := /TEI.2 [ .//letHeading[author&='streuvels'] , $mijnheer := /TEI.2 [ .//abbr[@expan&='mijnheer']] return $streuvels intersect $mijnheer Le 04/06/2004 04:35 PM, Ron Van den Branden a écrit : > Hi, > > There seem to be some problems with the evaluation of queries > restrained by complex XPath predicates. I'm quite sure it has nothing > to do with my data, rather with the combination of the abbreviated > axis specifier './/', and the 'and' and 'or' operators. However, since > my data has a more complex structure than the Shakespeare examples, it > was more convenient to base my report on these figures. > > Initial observations of correct behaviour: > ========================================== > I have a collection of 1748 documents > > 1) 458 of which have 'streuvels' in the <author> tag: > /TEI.2[.//letHeading[author&='streuvels']] returns 458 hits > 2) 96 of which have 'mijnheer' as value for the '@expan' attribute in > the <abbr> tag: > /TEI.2[.//abbr[@expan&='mijnheer']] returns 96 hits > 3) 7 of which have 'streuvels' in the <author> tag AND 'mijnheer' as > value for the '@expan' attribute in the <abbr> tag: > /TEI.2//letHeading[author&='streuvels'][.//abbr[@expan&='mijnheer']] > returns 7 hits ------------[ I think you forgot a [ here before letHeading . > 4) 547 of which have 'streuvels' in the <author> tag OR 'mijnheer' as > value for the '@expan' attribute in the <abbr> tag: > /TEI.2[.//abbr[@expan&='mijnheer']] | > /TEI.2[.//letHeading[author&='streuvels']] returns 547 hits > > Where things go wrong: > ====================== > 5) The intersection of query 3) reformulated as a complex predicate: > > /TEI.2[.//letHeading[author&='streuvels'] and > .//abbr[@expan&='mijnheer']] returns 458 hits > /TEI.2[.//abbr[@expan&='mijnheer'] and > .//letHeading[author&='streuvels']] returns 96 hits > > Seemingly, only the results of the first predicate part are returned. > > 6) The union of 4) expressed as a complex predicate: > /TEI.2[.//abbr[@expan&='mijnheer'] or > .//letHeading[author&='streuvels']] returns 1748 hits > > Which is the whole of my document set. > > When complex predicates behave correctly: > ========================================= > When in complex predicates the './/' abbreviated axis specifier is > replaced by 'descendant::', they return the correct number of results: > > 7) intersection: > /TEI.2[descendant::letHeading[author&='streuvels'] and > descendant::abbr[@expan&='mijnheer']] returns 7 hits > /TEI.2[descendant::abbr[@expan&='mijnheer'] and > descendant::letHeading[author&='streuvels']] returns 7 hits > > 8) union: > /TEI.2[descendant::abbr[@expan&='mijnheer'] or > descendant::letHeading[author&='streuvels']] returns 547 hits > > I've produced these results with the 'basic XQuery Interface' example > with eXist-snapshot20040331. > > Ron > -- Jean-Marc Vanel 01 39 43 31 46 Conseil et Services / développement & intégration logiciels Logiciel libre, Web, Java, XML ... A la pointe de la technique, au service des projets http://jmvanel.free.fr/ ===) CV, software resources Mes journaux: - sujets généraux en Français: http://jmvanel.free.fr/Block-note.html - sujets informatiques en Français: http://jmvanel.free.fr/notes-informatiques.html - computer science diary : http://jmvanel.free.fr/computer-notes.html Worldwide Botanical Knowledge Base http://wwbota.free.fr/ test XML query engine: http://jmvanel.free.fr/protea.html |