<?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>11073</bug_id>
          
          <creation_ts>2010-10-16 18:24:47 +0000</creation_ts>
          <short_desc>Type errors during XPath evaluation</short_desc>
          <delta_ts>2011-03-04 23:54:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Structures: XSD Part 1</component>
          <version>1.1 only</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>resolved</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="David Ezell">David_E3</assigned_to>
          <cc>cmsmcq</cc>
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41457</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-10-16 18:24:47 +0000</bug_when>
    <thetext>In section 3.12.4 (CTA) it is stated that &quot;If a dynamic error or a type error is raised during evaluation, then the {test} is treated as if it had evaluated (without error) to false.&quot;

This is then glossed in a Note: &quot;Dynamic errors and type errors in the evaluation of {test} expressions cause neither the schema nor the document instance to be invalid.&quot;

The reader could be forgiven for missing the significance of the phrase &quot;during evaluation&quot; | &quot;in the evaluation&quot; in these sentences. Neither is intended to apply to type errors that are detected statically. XPath processors are at liberty to detect type errors statically, and such errors should be handled in the same way as syntax errors in the XPath expression - that is, a violation of the constraints on schema documents. It would be easy enough to add to the note the sentence: &quot;However, if type errors are detected statically by the XPath processor, the effect is the same as for other static errors in the XPath expression.&quot;

This then raises the question that 3.12.6 states:

&quot;The {expression} property of the XPath Expression is a valid XPath expression, as defined in [XPath 2.0].&quot;

However, XPath 2.0 does not define the term &quot;valid XPath expression&quot;. I think that what is intended is &quot;an XPath expression containing no static errors&quot;.

The text for assertions in 3.13.6.2 makes the same mistake in referring to &quot;valid XPath expressions.&quot;

For evaluation of assertions, I can&apos;t find any text equivalent to that in CTA that says dynamic errors cause the assertion to be treated as false. Perhaps I missed it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42186</commentid>
    <comment_count>1</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2010-11-05 14:12:33 +0000</bug_when>
    <thetext>In Lyon:

Replace the term &quot;Valid XPath Expression&quot; with a more correct term, or define what we mean by &quot;Valid XPath Expression&quot;, and specify that in the case of dynamic errors, assertions always evaluate to FALSE.  It&apos;s implementation defined when type errors are detected, and whther they are treated as static or dynamic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45808</commentid>
    <comment_count>2</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2011-02-18 17:26:52 +0000</bug_when>
    <thetext>RESOLVED: adopt [http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.b11073.html], adding the note in 3.13.4.2 to 3.13.6.2  [http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.html#xpath-valid]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46372</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2011-03-04 23:05:03 +0000</bug_when>
    <thetext>The proposal mentioned in comment 2 has been integrated into the status-quo document as amended.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>