<?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>19626</bug_id>
          
          <creation_ts>2012-10-19 08:55:29 +0000</creation_ts>
          <short_desc>[XQ31] Awkward option declarations</short_desc>
          <delta_ts>2014-04-22 15:43:24 +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>XQuery 3.1</component>
          <version>Working drafts</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="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>mike</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>76663</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-10-19 08:55:29 +0000</bug_when>
    <thetext>Consider the following query.

import schema namespace s = &quot;http://www.w3.org/XQueryTest/RequireProhibitF
eature&quot;;

declare function local:foo() as schema-element(s:foo) 
{
 ...
}

declare option prohibit-feature &quot;schema-aware&quot;;

local:foo()


It is not until we are well into parsing that the option prohibiting use of import schema is encountered.  This is quite annoying.


Consider also a processor which has schema awareness disabled by default.

import schema namespace s = &quot;http://www.w3.org/XQueryTest/RequireProhibitF
eature&quot;;

declare function local:foo() as schema-element(s:foo) 
{
 ...
}

declare option require-feature &quot;schema-aware&quot;;

local:foo()

It is not until we are well into parsing that the option enabling use of import schema is encountered.  This is similarly annoying.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76664</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-10-19 09:08:13 +0000</bug_when>
    <thetext>Another example of the same effect occurs when the higherOrderFunction feature is disabled after a function or variable declaration that makes use of it.

However, I&apos;m inclined to live with it. In general, we allow forwards references; it&apos;s a hassle for implementors, but that&apos;s the job that implementors are paid for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76667</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-10-19 09:16:19 +0000</bug_when>
    <thetext>There&apos;s also a usability issue.  It&apos;s natural to write the require/prohibit before the feature is used - but this is grammatically incorrect.

Other examples include use of validate expressions in a function, or use of fn:serialize with serialization disabled.

That means it&apos;s awkward for every XQuery 3.0-defined feature except static typing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76673</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-10-19 11:02:05 +0000</bug_when>
    <thetext>Additionally, I don&apos;t find this construct particularly intuitive.

Without a detailed reading of the specification, I&apos;d expect:

      declare option prohibit-feature &quot;higher-order-function&quot;;
      declare option require-feature &quot;all-optional-features&quot;;

either 

a) to complain that the higher-order-function feature is both prohibited and required (since higher-order-function is in the set of all optional features), OR
b) to disable the higher-order-function feature and then re-enable it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77293</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-10-29 15:51:26 +0000</bug_when>
    <thetext>The Working Group has decided not to change this in XQuery 3.0. Feel free to open this against 3.1 as a potential requirement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77386</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-10-30 09:54:16 +0000</bug_when>
    <thetext>Reopening as a potential change for XQuery 3.1.

I suggest something along the lines of

[6]    	Prolog 	   ::=    	
((DefaultNamespaceDecl | NamespaceDecl) Separator)* 
((OptionDecl) Separator)*
((DefaultNamespaceDecl | Setter | NamespaceDecl | Import) Separator)* 
((ContextItemDecl | AnnotatedDecl | OptionDecl) Separator)*

to permit option declarations to appear before schema/module imports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104169</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-04-22 15:43:01 +0000</bug_when>
    <thetext>We had no consensus to adopt this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104170</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2014-04-22 15:43:24 +0000</bug_when>
    <thetext>Happy to close.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>