<?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>12009</bug_id>
          
          <creation_ts>2011-02-08 10:25:31 +0000</creation_ts>
          <short_desc>[XQFTTS] FTNot-q6</short_desc>
          <delta_ts>2011-03-17 08:13:35 +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</component>
          <version>Proposed Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Tim Mills">tim</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jmdyck</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>45260</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-02-08 10:25:31 +0000</bug_when>
    <thetext>Our implementation disagrees with the expected (empty sequence) result for test FTNot-q6.

(: FTNot-q6: violates negation restriction 2: FTST0002 possible :)

(: insert-start :)
declare variable $input-context external;
(: insert-end :)

(: nothing :)
$input-context/books/book[para contains text &quot;software&quot; ftand (&quot;coder&quot; ftand ftn
ot
&quot;ninja&quot; window 5 words)]/title

Consider the paragraph:

   &lt;para&gt;Amazingly enough, many people believe that nunchuks are not useful
    to software development! They prefer usability studies to the swift
    application of physical means of persuasion. Hah! The ninja coder knows
    otherwise.
    &lt;/para&gt;

and the predicate

para contains text &quot;software&quot; ftand (&quot;coder&quot; ftand ftnot &quot;ninja&quot; window 5 words

Indexing word positions at 1, &apos;ninja&apos; is at position 29 (a StringExclude) and &apos;coder&apos; is at 30 (a StringInclude).

Using the function fts:ApplyFTWordWindow  at 

http://www.w3.org/TR/xpath-full-text-10/#tq-ft-fs-FTWindow

n = 5
minpos = 30
maxpos = 30
windowStartPos ranges from 26 to 30 (inclusive)

When windowStartPos is 30, windowEndPos is 34.

Thus:

         for $stringExclude in $match/fts:stringExclude
            where $stringExclude/fts:tokenInfo/@startPos &gt;=
                  $windowStartPos
              and $stringExclude/fts:tokenInfo/@endPos &lt;=
                  $windowEndPos
            return $stringExclude

returns the empty sequence, because 

$stringExclude/fts:tokenInfo/@startPos = 29 which is less than the windowStartPos, thus there exists a window starting at the word &apos;coder&apos; which doesn&apos;t include &apos;ninja&apos;.  The match contains no stringExcludes so gives the query a result of &lt;title&gt;Ninja Coder&lt;/title&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45265</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-02-08 11:48:37 +0000</bug_when>
    <thetext>FTNot-unconstrained-q6 appears to contain an identical query and so has an identical problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45266</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-02-08 11:50:04 +0000</bug_when>
    <thetext>FTNot-q6-unconstrained-window also appears to contain an identical query and so has an identical problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45882</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2011-02-21 07:23:28 +0000</bug_when>
    <thetext>(personal response:) I agree with your analysis in comment #0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46728</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2011-03-15 19:08:02 +0000</bug_when>
    <thetext>At their joint meeting on February 22nd, the WGs agreed that the test-case was broken, and directed me to fix it. I have now committed revised versions of:
ExpectedTestResults/Expressions/Operators/CompExpr/FTContainsExpr/FTSelection/FTOperators/FTUnaryNot/FTNot-q6.txt ExpectedTestResults/Expressions/Operators/CompExpr/FTContainsExpr/FTSelection/FTOperators/FTUnaryNot/FTNot-unconstrained-q6.txt
Both now contain:
    &lt;title&gt;Ninja Coder&lt;/title&gt;
as you advised.

The test-case FTNot-q6-unconstrained-window (which you mentioned in comment 2) re-uses FTNot-q6.txt for its expected result, so it&apos;s handled by the above change.

I&apos;m marking this bug resolved-fixed. Please mark it closed if you agree with this resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46777</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-03-17 08:13:35 +0000</bug_when>
    <thetext>Confirmed fixed.  Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>