This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5843 - xquery full text usecase 16.2.9 Q9 solution not correct
Summary: xquery full text usecase 16.2.9 Q9 solution not correct
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 Use Cases (show other bugs)
Version: Working drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Pat Case
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-08 20:20 UTC by zhen hua liu
Modified: 2011-01-07 00:09 UTC (History)
1 user (show)

See Also:


Attachments

Description zhen hua liu 2008-07-08 20:20:20 UTC
http://www.w3.org/TR/xpath-full-text-10-use-cases/#xquery-xpath-composability-queries-results-q9
current solution is
for $book in doc("http://bstore1.example.com/full-text.xml")
   /books/book
for $cont := $book/content[. ftcontains ("successfully" 
   ftand "completing" ftand "tasks") with stemming
   window (count(./contents/part/chapter) * 3) 
   words] 
where count($cont)>0
return ($book/metadata/title, $cont)

the correct solution is
for $book in doc("http://bstore1.example.com/full-text.xml")
   /books/book
let $cont := $book/content[. ftcontains ("successfully" 
   ftand "completing" ftand "tasks") with stemming
   window (count(./part/chapter) * 3) 
   words] 
where count($cont)>0
return ($book/metadata/title, $cont)

second 'for clause' shall be 'let clause'. ./contents path shall be eliminated because there is NO contents element.
Comment 1 Pat Case 2008-07-14 20:09:52 UTC
Zhen,

I handled these as editorial.

I changed the 2nd for clause to a let in the XQuery solution.

I fixed the ./contents/part/chapter paths in bothe XQuery and XPath solutions.

The correction will appear internally after the next use cases build. I will
send the FTTF an alert when it is ready. 

Please review and if you agree with the change, close the bug.

Pat