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=26991>.
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=26991

replaceWholeText with empty string as replacement text not returning null on 
parentless text node 

           Summary: replaceWholeText with empty string as replacement text
                    not returning null on parentless text node
           Product: Xerces2-J
           Version: 2.6.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Invoking replaceWholeText on a newly created Text Node (parentNode null) with 
replacement text as the empty string, does not return null.  Current behavior 
causes DOM L3 test textreplacewholetext04 to fail.

Not entirely sure if this patch is correct:

--- java/src/org/apache/xerces/dom/AttrImpl.java 2004-02-16 16:58:02  Rev.1.22
+++ C:\xml-xerces_temp\TextImpl.java             2004-02-16 16:58:02
@@ -240,15 +240,16 @@
         
         Node parent = this.getParentNode();
-        if (content == null || content.length() == 0) {
-            // remove current node
-            if (parent !=null) { // check if node in the tree
-                parent.removeChild(this);
-                return null;
-            }
-        }
+        if (content == null || content.length() == 0) {
+             // remove current node
+             if (parent !=null) { // check if node in the tree
+                 parent.removeChild(this);
+             }
+             this.setData(content);
+             return null;
+         }

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

Reply via email to