This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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)
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