DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27350>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27350

Renaming document node should result in NOT_SUPPORTED_ERR not WRONG_DOC

           Summary: Renaming document node should result in
                    NOT_SUPPORTED_ERR not WRONG_DOC
           Product: Xerces2-J
           Version: 2.6.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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);
        }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to