<?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>4242</bug_id>
          
          <creation_ts>2007-01-17 08:31:40 +0000</creation_ts>
          <short_desc>[FS] Static typing of name tests</short_desc>
          <delta_ts>2007-10-03 23:05:02 +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>Formal Semantics 1.0</component>
          <version>Candidate Recommendation</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="Jens Teubner">jens.teubner</reporter>
          <assigned_to name="Michael Dyck">jmdyck</assigned_to>
          <cc>nick</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>13641</commentid>
    <comment_count>0</comment_count>
    <who name="Jens Teubner">jens.teubner</who>
    <bug_when>2007-01-17 08:31:40 +0000</bug_when>
    <thetext>Hi Jerome,

correct me if I am wrong, but I think there is a problem with the static type inference rules in Section 8.2.3.1.1 (Name Tests).

Consider the expression

  $v/self::foo

and $v has the static type `element *&apos; (we know it&apos;s exactly one element, but we don&apos;t know its name).

The Formal Semantics essentially depends on two judgments to derive the result type of this expression:

  axis self:: of element * : element *      (Sect. 8.2.2.1.2)

then

  test foo with element of element * : element foo .

The latter is a rule in Section 8.2.3.1.1 where we perform a (non-wildcard) name test on an element type with a wildcard name:


--------------------------------------------------------------------------------
 test QName2 with element of element * OptTypeSpec : element QName2 OptTypeSpec

I think a `?&apos; occurrence indicator is missing here.  If $v in the above example is a `foo&apos; element, the result type is indeed `element foo&apos;.  But if $v carries a different name (say, `bar&apos;) the path step will return the empty sequence (which would not be permitted by the above static typing rule).

The same problem arises also in some of the remaining judgments in Section 8.2.3.1.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14191</commentid>
    <comment_count>1</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2007-02-26 00:10:01 +0000</bug_when>
    <thetext>The fix for this bug does not appear in the Recommendation of 23 January 2007. 
It will be considered for a future publication (either an Errata document or
some possible future version of the specification). </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14937</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2007-04-28 07:32:56 +0000</bug_when>
    <thetext>I agree with the original comment. Specifically, we need to append a &apos;?&apos; to the conclusion of rules 2, 5, 7, 10, 13, and 15 (i.e., the rules with &quot;element * OptTypeSpecifier&quot; or &quot;attribute * OptTypeReference&quot;).

(You might think that rules 3 and 11 would also be affected, but they&apos;ll be deleted pursuant to Bug 3269.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14981</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2007-05-03 02:14:58 +0000</bug_when>
    <thetext>The working groups have approved the solution given in Comment #2. Consequently, I am marking this bug FIXED. Please indicate your acceptance of this resolution by marking the bug CLOSED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14986</commentid>
    <comment_count>4</comment_count>
    <who name="Jens Teubner">jens.teubner</who>
    <bug_when>2007-05-03 12:21:01 +0000</bug_when>
    <thetext>The solution looks fine to me.  Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15249</commentid>
    <comment_count>5</comment_count>
    <who name="Nick Jones">nick</who>
    <bug_when>2007-05-30 09:06:10 +0000</bug_when>
    <thetext>*** Bug 4581 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17018</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2007-10-03 23:05:02 +0000</bug_when>
    <thetext>This issue has been incorporated into FS erratum E018, whose fix has been committed to the source files for the next edition of the FS document.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>