[Bug 5829] New: xquery full text use case document has WRONG xpath solutions

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5829

           Summary: xquery full text use case document has WRONG xpath
                    solutions
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Full Text 1.0
        AssignedTo: jim.melton@acm.org
        ReportedBy: zhen.liu@oracle.com
         QAContact: public-qt-comments@w3.org


In http://www.w3.org/TR/xpath-full-text-10-use-cases/ Working Draft 16 May 2008
version (including its previous drafts), there is a fundamental mistake in the
xpath solutions for majority of the use case examples.
For example, in section 3.2.1, the xpath solution IS NOT correct.
Solution in XPath:
===================
doc("http://bstore1.example.com/full-text.xml")
/books/book[count(.//chapter ftcontains "one of 
the best known lists of heuristics is Ten Usability 
Heuristics")>0]

The count() function in the predicates counts the ftcontains expression result,
which is always a single boolean value of "true" or "false". Therefore, count()
function here always return 1 and since 1 > 0, so the 'book' element is always
returned. 

The correct solution is 

doc("http://bstore1.example.com/full-text.xml")
/books/book[count(.//chapter [. ftcontains "one of 
the best known lists of heuristics is Ten Usability 
Heuristics"] )>0]

Here count() function counts number of 'chapter' element nodes which satisfies
the ftcontains expression. Note we use another predicate [] to surround the
ftcontains expression. 
This incorrect solution is everywhere in the use case document when the xpath
solution with count() is used as solution. 

This needs to be fixed. Also part of the full text conformance tests include
these use case examples. So we need to make sure the test case does NOT have
the same mistake.  I checked the lastest CVS for xquery full text conformance
tests, the following queries have already inherited the same mistakes:
./UseCase/UseCase-ACROSS/across-queries-results-q1b.xq
./UseCase/UseCase-ACROSS/across-queries-results-q2b.xq
./UseCase/UseCase-ACROSS/across-queries-results-q3b.xq
./UseCase/UseCase-ELEMENT/element-queries-results-q6b.xq
./UseCase/UseCase-ELEMENT/element-queries-results-q7b.xq


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 2 July 2008 19:18:28 UTC