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 5702 - [UPD] Deleting a parentless node should be well-defined
Summary: [UPD] Deleting a parentless node should be well-defined
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Candidate Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-20 16:55 UTC by Jonathan Robie
Modified: 2011-01-08 20:45 UTC (History)
1 user (show)

See Also:


Attachments

Description Jonathan Robie 2008-05-20 16:55:32 UTC
The following text occurs in the definition of upd:delete: "If $target has no parent, the XDM instance is unchanged. An implementation may (but is not required to) raise a dynamic error if $target had no parent before execution of the query began. [err:XUDY0020]."

For the user, I think it is better if the standard defines what happens if we delete a node that does not have a parent. What barriers are there to doing this?

If there is an insurmountable difficulty with defining this, we need to at least say that it is implementation defined, and needs to be documented.
Comment 1 Michael Kay 2008-05-20 17:12:30 UTC
Section 2.4.2 in fact says (in a Note) that it is "implementation-defined".

But I fully agree with the comment, there is no reason for the WG to be indecisive on this question. I really don't care much whether deleting a parentless node is a no-op or an error, but I think the spec should define it one way or the other. Tossing a coin, I would make it a no-op (the only defined behaviour of delete is to detach from the parent, and when the initial state is the same as the desired state, a no-op seems appropriate.)
Comment 2 Jonathan Robie 2008-11-03 16:56:40 UTC
On 16 Sept 08, we decided deleting a node that is already detached is a no-op, not implementation defined, and may not be treated as an error.
Comment 3 Jonathan Robie 2011-01-08 20:45:48 UTC
I am happy with the resolution.