<?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>12127</bug_id>
          
          <creation_ts>2011-02-18 20:41:19 +0000</creation_ts>
          <short_desc>&quot;Root element&quot; in assertion testing</short_desc>
          <delta_ts>2011-03-04 23:54:03 +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>
    
    <cc>gandhi.mukul</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>45825</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-02-18 20:41:19 +0000</bug_when>
    <thetext>The specification states in part 1, 3.1.31, &quot;To check an assertion, an instance of the XPath 2.0 data model ([XDM]) is constructed, in which the element information item being ·assessed· is the root element...&quot;

The term &quot;root element&quot; here is unfortunate. XML 1.0 uses the term for the outermost element of a document. XDM does not use the term. Saxon&apos;s reading of the spec is that the element becomes the root node of a tree (and is therefore parentless). Judging from test d4_3_14v14, IBM&apos;s interpretation is that the element becomes the outermost element in a tree whose root is a document node, the document node being the parent of this element. In consequence, the test 

count(//ele1) eq 1

raises a dynamic error (and hence returns false) in Saxon, because an expression beginning &quot;/&quot; or &quot;//&quot; cannot be used when the context item is in a tree whose root is not a document node.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45858</commentid>
    <comment_count>1</comment_count>
    <who name="Mukul Gandhi">gandhi.mukul</who>
    <bug_when>2011-02-19 03:31:01 +0000</bug_when>
    <thetext>I agree with Mike that this particular ambiguity is obvious.

Here&apos;s a quick proposal to resolve this ambiguity,

1) We may change description in section &quot;3.13.1 The Assertion Schema Component&quot; somewhat and the new wording might be:
&quot;To check an assertion, an instance of the XPath 2.0 data model ([XDM]) is constructed, in which the element information item being ·assessed· is the context item of the XPath 2.0 dynamic context, and elements and attributes ...&quot;

instead of the phrase cited by Mike. This then also becomes consistent with section &quot;3.13.4.2 XPath Evaluation&quot; of the spec which says:
1 The context item is E.

2) We modify the test case cited by Mike to have the expression,
count(.//ele1) eq 1

instead of,
count(//ele1) eq 1

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46059</commentid>
    <comment_count>2</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2011-02-25 16:33:41 +0000</bug_when>
    <thetext>RESOLVED: editors to draft wording that makes clear that the subtree is rooted in a parentless element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46308</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2011-03-04 04:15:25 +0000</bug_when>
    <thetext>Proposal for bug 12127:  

In section 3.13.1 The Assertion Schema Component, 
in the sentence

   To check an assertion, an instance of the XPath 2.0 data 
   model ([XDM]) is constructed, in which the element information 
   item being ·assessed· is the root element, and elements and 
   attributes are assigned types and values according to XPath 
   2.0 data model construction rules, with some exceptions.

replace &quot;root element&quot; with &quot;(parentless) root node&quot;.

No other change required; the detailed XDM construction rules
further on in the section are already clear that the node has no
parent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46332</commentid>
    <comment_count>4</comment_count>
    <who name="David Ezell">David_E3</who>
    <bug_when>2011-03-04 16:28:16 +0000</bug_when>
    <thetext>RESOLVED:  adopt the wording in comment #3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46371</commentid>
    <comment_count>5</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2011-03-04 23:02:44 +0000</bug_when>
    <thetext>The change proposal in comment 3 has now been integrated into the status-quo document.

Michael, as the originator please check the resolution and close or reopen the issue; thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>