This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
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
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