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 5854 - xquery full text use case 13.2.3 solution is not correct
Summary: xquery full text use case 13.2.3 solution is 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-10 20:42 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-10 20:42:21 UTC
In 
http://www.w3.org/TR/xpath-full-text-10-use-cases/#axes-queries-results-q3
The solution below
for $book in doc("http://bstore1.example.com/full-text.xml")
   /books/book[@number="3"]
let $comp := $book[./content/part/component/
   (subcomponent | subcomponent/subsubcomponent)/
   componentTitle ftcontains "flow diagram.?" 
   with wildcards]
let $parentComp := $book[ancestor::books//../$comp 
  ftcontains "human computer interaction"]
where count($comp) > 0   
return ($book/metadata/title, $book/content)

is NOT correct. The $comp variable reference in the middle of xpath step is not correct. Also, the element tag shall be subComponent instead of subcomponent.

Here is the correct solution:

for $book in doc("xq-full-text.xml")
   /books/book[@number="3"]
let $comp := $book[./content/part/component/
    (subComponent |subComponent/subsubComponent)/
   componentTitle ftcontains "flow diagram.?" with wildcards
   ]
let $parentComp := $comp/ancestor::node()[.//componentTitle
  ftcontains "human computer interaction"]
where count($comp) > 0   and count($parentComp) > 0
return ($book/metadata/title, $book/content)
Comment 1 Pat Case 2008-07-16 15:36:08 UTC
Zhen,

I handled this as editorial.

I camel-cased element names and corrected the paths defining the variables in the XQuery and XPath solutions. Added a 2nd count clause in the XQuery solution. Corrected the Query Context.

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