This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1861 - [Xquery] Text node constructors: parent property
Summary: [Xquery] Text node constructors: parent property
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-19 15:58 UTC by Michael Kay
Modified: 2005-09-14 17:37 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2005-08-19 15:58:15 UTC
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{"fred"}
  return count($x/..)
}

The "nearest containing document constructor" 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
Comment 1 Don Chamberlin 2005-08-31 23:52:04 UTC
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
Comment 2 Don Chamberlin 2005-09-14 17:37:04 UTC
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 "base uri" property to be handled by element constructors consistently with 
the "parent" property.
Section 3.7.1.3: delete rule 5-b-ii
Section 3.7.3.1: delete rule 4-b-ii
Don Chamberlin