<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>5854</bug_id>
          
          <creation_ts>2008-07-10 20:42:21 +0000</creation_ts>
          <short_desc>xquery full text use case 13.2.3 solution is not correct</short_desc>
          <delta_ts>2011-01-07 00:09:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Full Text 1.0 Use Cases</component>
          <version>Working drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="zhen hua liu">zhen.liu</reporter>
          <assigned_to name="Pat Case">pcase</assigned_to>
          <cc>jim.melton</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21139</commentid>
    <comment_count>0</comment_count>
    <who name="zhen hua liu">zhen.liu</who>
    <bug_when>2008-07-10 20:42:21 +0000</bug_when>
    <thetext>In 
http://www.w3.org/TR/xpath-full-text-10-use-cases/#axes-queries-results-q3
The solution below
for $book in doc(&quot;http://bstore1.example.com/full-text.xml&quot;)
   /books/book[@number=&quot;3&quot;]
let $comp := $book[./content/part/component/
   (subcomponent | subcomponent/subsubcomponent)/
   componentTitle ftcontains &quot;flow diagram.?&quot; 
   with wildcards]
let $parentComp := $book[ancestor::books//../$comp 
  ftcontains &quot;human computer interaction&quot;]
where count($comp) &gt; 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(&quot;xq-full-text.xml&quot;)
   /books/book[@number=&quot;3&quot;]
let $comp := $book[./content/part/component/
    (subComponent |subComponent/subsubComponent)/
   componentTitle ftcontains &quot;flow diagram.?&quot; with wildcards
   ]
let $parentComp := $comp/ancestor::node()[.//componentTitle
  ftcontains &quot;human computer interaction&quot;]
where count($comp) &gt; 0   and count($parentComp) &gt; 0
return ($book/metadata/title, $book/content)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21199</commentid>
    <comment_count>1</comment_count>
    <who name="Pat Case">pcase</who>
    <bug_when>2008-07-16 15:36:08 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>