You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by ji...@apache.org on 2004/04/23 19:52:53 UTC

[jira] Closed: (XERCESJ-905) Renaming document node should result in NOT_SUPPORTED_ERR not WRONG_DOC

Message:

   The following issue has been closed.

   Resolver: Michael Glavassevich
       Date: Fri, 23 Apr 2004 10:51 AM

Closed as per state in Bugzilla.
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESJ-905

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESJ-905
    Summary: Renaming document node should result in NOT_SUPPORTED_ERR not WRONG_DOC
       Type: Bug

     Status: Closed
 Resolution: FIXED

    Project: Xerces2-J
 Components: 
             DOM
   Versions:
             2.6.2

   Assignee: Michael Glavassevich
   Reporter: Naela Nissar

    Created: Mon, 1 Mar 2004 10:23 PM
    Updated: Fri, 23 Apr 2004 10:51 AM
Environment: Operating System: Other
Platform: Other

Description:
When attempting to rename a document node using the document.renameNode method, 
a WRONG_DOCUMENT_ERR is thrown.  Currently failing W3C DOM test cases 
documentrenamenode23 and documentrenamenode24. renameNode method only 
supports the renaming of an existing node of type ELEMENT_NODE or 
ATTRIBUTE_NODE. The problem is that the ownerDocument of a document node 
returns null. Should pass control on so that a NOT_SUPPORTED_ERR exception be 
raised since 'the type of specified node is neither ELEMENT_NODE
or ATTRIBUTE_NODE' 

Proposed patch in CoreDocumentImpl.renameNode

public Node renameNode(Node n,String namespaceURI,String name)
    throws DOMException{

   if (n.getOwnerDocument() != this &&
+           	n.getOwnerDocument() != getOwnerDocument()) {
            String msg = DOMMessageFormatter.formatMessage(
            DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
        }


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org