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 5337 - [UPD] removeType() as a result of replace node
Summary: [UPD] removeType() as a result of replace node
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: 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-01-02 18:14 UTC by Michael Kay
Modified: 2008-01-26 22:06 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2008-01-02 18:14:33 UTC
The rules for insert and delete are careful to call removeType() only if the nodes being inserted/deleted can affect the type (that is, if they are elements, attributes, or text nodes). The rules for replace make no such provision; they remove the type annotation even if the only effect is to replace a comment with a processing instruction. It's a minor point, but the rules should be symmetrical.

removeType() is necessary if either the node being replaced or one of the nodes inserted in its place is a text, attribute, or element node.
Comment 1 Don Chamberlin 2008-01-15 01:19:30 UTC
I agree with Mike. We should make the following change:

In Section 3.1.8 (upd:replaceNode), change Rule 4d as follows:

(d) If $target or any node in $replacement is an element, attribute, or text node,  upd:removeType(parent($target)) is invoked.
Comment 2 Don Chamberlin 2008-01-26 22:06:41 UTC
Michael,
On 22 Jan 2008, the Query Working Group considered this bug report and accepted the proposed change in Comment #1. Since this change is aligned with your suggestion, I am marking this bug report as Closed.
--Don Chamberlin (for the Query Working Group)