<?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>7247</bug_id>
          
          <creation_ts>2009-08-09 09:46:16 +0000</creation_ts>
          <short_desc>xquery full text grammar ambiguity?</short_desc>
          <delta_ts>2009-12-08 20:31:37 +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>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="Nikolay Ognyanov">nikolay.ognyanov</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jmdyck</cc>
    
    <cc>Probst_Martin</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>26323</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2009-08-09 09:46:16 +0000</bug_when>
    <thetext>Consider the following expression:

element ftcontains {&apos;whatever&apos;}

Without full text it is clearly a computed element constructor. With full text though it seems to also be FtContainsExpr by the rule

FTContainsExpr ::= RangeExpr ( &quot;ftcontains&quot; FTSelection FTIgnoreOption? )?

since &apos;element&apos; is a valid relative path and hence - RangeExpr and &apos;{&apos;whatever&apos;}&apos; is a valid FtWordsValue and hence - FTSelection. I am not able to find in candidate recommendation from 07/09/2009 anything that would resolve this ambiguity. Am I missing something? Similar constructs seem possible with &apos;ftand&apos; and &apos;ftor&apos; and with other computed constructors. Root cause of the problem seems to be the &quot;naked&quot; curly bracket construct in FTWordsValue. There used to be similar problems with &quot;naked&quot; blocks in Scripting which were resolved by lead-in token &quot;block&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26353</commentid>
    <comment_count>1</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2009-08-10 13:45:09 +0000</bug_when>
    <thetext>P.S.: Sorry, I should have possibly suggested a fix (in case I am not mistaken about the ambiguity). What I would suggest is modification of the rule for FTWordsValue as follows:

FTWordsValue ::= Literal | (&quot;words&quot; &quot;{&quot; Expr &quot;}&quot;)

The unhappy disadvantage of this is more verbose syntax of Full Text. The advantage which IMO prevails is upward compatibility with XQuery in the example above and similar.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27036</commentid>
    <comment_count>2</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2009-09-11 02:12:43 +0000</bug_when>
    <thetext>This is a status report, not an indication of completion:

The Full Text Task Force, as well as the XML Query and XSL WGs, are currently wrestling with this issue.  One fix was suggested that solved the problem at the cost of some confusion to novice full-text users, but the WGs have pushed back a bit asking for further thought to be given to other possible solutions. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28141</commentid>
    <comment_count>3</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2009-10-08 22:22:51 +0000</bug_when>
    <thetext>In its teleconference of 2009-09-28, the Full Text Task Force adopted a solution to this bug that was prescribed by the joint XSL WG and XML Query WG teleconference of 2009-09-22.  That solution is to replace the keyword &quot;ftcontains&quot; with the keyword pair &quot;contains text&quot;. 

As a result of this change, I have marked this bog RESOLVED/FIXED.  If you accept this resolution, please mark it CLOSED. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28364</commentid>
    <comment_count>4</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2009-10-15 13:37:38 +0000</bug_when>
    <thetext>I agree that this solves the ambiguity caused by &quot;ftcontains&quot;. I still experience some problems with by &quot;ftand&quot; and &quot;ftor&quot; but those may hopefully be fixed with the fix for bug #7271.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28387</commentid>
    <comment_count>5</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2009-10-16 01:17:48 +0000</bug_when>
    <thetext>P.S. : Unfortunately problems with &quot;ftand&quot; and &quot;ftor&quot; persist after implementation of the fix for bug #7271. Some experiments with tweaking the grammar make me believe that problems occur when these 2 are used in conjunction with &quot;weight&quot; and computed constructors. One example of the kind seems to be  this:

a contains text {&quot;something&quot;} weight element ftand {&quot;other&quot;}

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28388</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2009-10-16 02:20:52 +0000</bug_when>
    <thetext>Yup, I think you&apos;re right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29978</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2009-12-08 00:34:11 +0000</bug_when>
    <thetext>Our solution to the problem raised in comment #5 is to change the syntax of FTWeight to require braces around the weight expression:

    FTWeight ::= &quot;weight&quot; &quot;{&quot; Expr &quot;}&quot;

We&apos;re fairly confident that this change doesn&apos;t raise any other parsing problems. Consequently, I&apos;m marking this bug Fixed. If you agree, please mark it Closed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30020</commentid>
    <comment_count>8</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2009-12-08 20:31:37 +0000</bug_when>
    <thetext>My experiments with parser generation confirm that this solution works. I agree that the problem is fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>