You are viewing a plain text version of this content. The canonical link for it is here.
Posted to crimson-cvs@xml.apache.org by ed...@apache.org on 2001/01/30 00:45:17 UTC

cvs commit: xml-crimson/src/org/apache/crimson/tree XmlDocumentBuilder.java

edwingo     01/01/29 15:45:16

  Modified:    src/org/apache/crimson/tree XmlDocumentBuilder.java
  Log:
  Do not merge TextNode data into preceding CDataNode
  
  Revision  Changes    Path
  1.3       +4 -3      xml-crimson/src/org/apache/crimson/tree/XmlDocumentBuilder.java
  
  Index: XmlDocumentBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/tree/XmlDocumentBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XmlDocumentBuilder.java	2001/01/20 01:07:23	1.2
  +++ XmlDocumentBuilder.java	2001/01/29 23:45:14	1.3
  @@ -1,5 +1,5 @@
   /* 
  - * $Id: XmlDocumentBuilder.java,v 1.2 2001/01/20 01:07:23 edwingo Exp $
  + * $Id: XmlDocumentBuilder.java,v 1.3 2001/01/29 23:45:14 edwingo Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -127,7 +127,7 @@
    * than matching an XML structure that may not be optimized appropriately.
    *
    * @author David Brownell
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class XmlDocumentBuilder implements ContentHandler, LexicalHandler,
       DeclHandler, DTDHandler
  @@ -546,7 +546,8 @@
           
   	try {
   	    NodeBase lastChild = (NodeBase) top.getLastChild ();
  -	    if (lastChild instanceof TextNode) {
  +	    if (lastChild != null && lastChild.getClass() == TextNode.class) {
  +                // Merge only TextNode data and not CDataNode data
   		String tmp  = new String (buf, offset, len);
   	   	((TextNode)lastChild).appendData (tmp);
   	    } else {