<?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>1861</bug_id>
          
          <creation_ts>2005-08-19 15:58:15 +0000</creation_ts>
          <short_desc>[Xquery] Text node constructors: parent property</short_desc>
          <delta_ts>2005-09-14 17:37:04 +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 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Michael Kay">mike</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          
          
          <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>5449</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-08-19 15:58:15 +0000</bug_when>
    <thetext>Section 3.7.3.4 says

The parent property of the text node is the node constructed by the nearest
containing element or document node constructor, either direct or computed, if
such a constructor exists; otherwise parent is empty.

This seems quite wrong. Consider

document{
  let $x := text{&quot;fred&quot;}
  return count($x/..)
}

The &quot;nearest containing document constructor&quot; is irrelevant here. This returns zero.

As with other constructors, the new node initially has no parent; evaluating the
document{} constructor makes a copy of the text node that does have a parent.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5631</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-08-31 23:52:04 +0000</bug_when>
    <thetext>Yes, you are right. In fact, this problem is rather widespread. On 31 Aug 2005 
the working group decided to fix all the node constructors, both direct and 
computed, to specify that the parent property of the constructed node is empty. 
This affects the following sections:
3.7.1.1 Rule 5c (direct element constructors)
3.7.2 (direct PI and comment constructors)
3.7.3.1 Rule 4c (computed element constructors)
3.7.3.2 (computed attribute constructors)
3.7.3.4 (text node constructors)
3.7.3.5 (computed PI constructors)
3.7.3.6 (computed comment constructors)
These changes have been implemented, and I have marked the bug report as fixed 
and closed. Please reopen the bug report if you have any further concerns.
Regards, --Don Chamberlin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6144</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-09-14 17:37:04 +0000</bug_when>
    <thetext>In addition to the changes already enumerated, I have made the following 
changes with the approval of the Query Working Group. These changes cause 
the &quot;base uri&quot; property to be handled by element constructors consistently with 
the &quot;parent&quot; property.
Section 3.7.1.3: delete rule 5-b-ii
Section 3.7.3.1: delete rule 4-b-ii
Don Chamberlin</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>