<?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>10696</bug_id>
          
          <creation_ts>2010-09-23 14:10:05 +0000</creation_ts>
          <short_desc>Tests that should allow XQST0022</short_desc>
          <delta_ts>2011-01-07 12:17:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.3</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</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="Michael Kay">mike</reporter>
          <assigned_to name="Benjamin Nguyen">benjie.nguyen</assigned_to>
          <cc>benjie.nguyen</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>39203</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-09-23 14:10:05 +0000</bug_when>
    <thetext>The following tests:

K2-DirectConElemNamespace-44
K2-DirectConElemNamespace-61
K2-DirectConElemNamespace-63
K2-DirectConElemNamespace-67
K2-DirectConElemNamespace-69

All contain an unpaired &quot;{&quot; within a namespace declaration on a direct element constructor. The parser is entitled to assume that this signals the start of an EnclosedExpr within the namespace value, and therefore to report error XQST0022.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39734</commentid>
    <comment_count>1</comment_count>
    <who name="Benjamin Nguyen">benjie.nguyen</who>
    <bug_when>2010-09-28 14:26:33 +0000</bug_when>
    <thetext>To be honnest I&apos;m not sure about the exact goal of the test, since it reads &quot;Use an inproperly enclosed expression inside an namespace declaration&quot;.

The spec says : If the DirAttributeValue  contains an EnclosedExpr, a static error is raised [err:XQST0022]

Looking at example K2-DirectConElemNamespace-44.xq : /www.example.com/{ my feeling is that this expression is not valid per the grammar and therefore is err:XQST0003. The DirAttributeValue does not contain an EnclosedExpr since it is defined by EnclosedExpr ::= &quot;{&quot; Expr  &quot;}&quot;, and such a pattern cannot be found. I believe the parser should also be looking for {{ so I&apos;m not sure why it would decide off the bat that { is an EnclosedExpr.  

One could also argue that { is only part of the unwise URI characters, so could be part of the uri (I&apos;m not a URI expert, so maybe I&apos;m wrong here). Maybe the example(s) should be changed though because I don&apos;t really understand what they try to acheive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39737</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-09-28 14:51:36 +0000</bug_when>
    <thetext>I think the examples were written when the rules were different, so whatever they were trying to achieve at the time is historic.

I don&apos;t want to get into arguments about what&apos;s the correct error code, especially for static errors where I don&apos;t believe there is ever a single  &quot;correct&quot; answer - the error code/message is essentially a guess at what the user intended to write, and such guesses will often be wrong. However, if an error code can be produced by a reasonable parser then we should allow it, and the following logic is entirely rational:

* I&apos;m processing an attribute value

* I&apos;ve seen an undoubled opening brace

* That means I&apos;ve got to start parsing an enclosed expression

* Hang on, this is a namespace, enclosed expressions aren&apos;t allowed.

The kind of error you get here is also going to depend on how you handle nested quotes. If you try to parse namespaces the way you parse attributes, then when you see

xxxx=&quot;abc{&quot; def &quot;}ghi&quot;

you&apos;re going to see an enclosed expression {&quot; def &quot;}. But if you parse namespaces differently from attributes, you&apos;re going to see xxx=&quot;abc{&quot;, which has an unmatched opening brace.

I&apos;m sure you&apos;re not trying to suggest that XQST0022 should only be raised if the enclosed expression within a namespace is otherwise error-free. Or are you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41546</commentid>
    <comment_count>3</comment_count>
    <who name="Benjamin Nguyen">benjie.nguyen</who>
    <bug_when>2010-10-19 13:27:57 +0000</bug_when>
    <thetext>After thinking it over, I&apos;m enclined to agree with Mike, and so I would also push for XQST0022 to be a legitimate answer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43907</commentid>
    <comment_count>4</comment_count>
    <who name="Benjamin Nguyen">benjie.nguyen</who>
    <bug_when>2011-01-07 12:17:07 +0000</bug_when>
    <thetext>Hi Mike,

I&apos;ve updated the catalog to allow an alternate error code, and uploaded to CVS.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>