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 bu...@apache.org on 2004/02/16 23:21:01 UTC

DO NOT REPLY [Bug 26991] New: - replaceWholeText with empty string as replacement text not returning null on parentless text node

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: xerces-j-dev@xml.apache.org
        ReportedBy: nnissar@ca.ibm.com


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: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org