You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2003/05/26 17:03:03 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/dom ParentNode.java
elena 2003/05/26 08:03:03
Modified: java/src/org/apache/xerces/dom ParentNode.java
Log:
Fixing bug in textContent (it should not return null for element.getTextContent).
This fixes the following bug reported for normalizeDocument: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20172
Revision Changes Path
1.40 +3 -3 xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java
Index: ParentNode.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ParentNode.java 8 May 2003 19:52:40 -0000 1.39
+++ ParentNode.java 26 May 2003 15:03:03 -0000 1.40
@@ -652,7 +652,7 @@
if (child != null) {
Node next = child.getNextSibling();
if (next == null) {
- return hasTextContent(child) ? child.getNodeValue() : "";
+ return hasTextContent(child) ? ((NodeImpl) child).getTextContent() : "";
}
StringBuffer buf = new StringBuffer();
getTextContent(buf);
@@ -692,7 +692,7 @@
removeChild(child);
}
// create a Text node to hold the given content
- if (textContent != null){
+ if (textContent != null && textContent.length() != 0){
appendChild(ownerDocument().createTextNode(textContent));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org