Author: mrglavas
Date: Mon Dec 14 19:55:41 2009
New Revision: 890459

URL: http://svn.apache.org/viewvc?rev=890459&view=rev
Log:
JIRA Issue #1407: http://issues.apache.org/jira/browse/XERCESJ-1407. Some 
additional improvements thanks to the patch by  Ludger Bünger. Use Document 
factory methods instead of directly calling constructors in HTMLBuilder.

Modified:
    xerces/java/trunk/src/org/apache/html/dom/HTMLBuilder.java

Modified: xerces/java/trunk/src/org/apache/html/dom/HTMLBuilder.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/html/dom/HTMLBuilder.java?rev=890459&r1=890458&r2=890459&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/html/dom/HTMLBuilder.java (original)
+++ xerces/java/trunk/src/org/apache/html/dom/HTMLBuilder.java Mon Dec 14 
19:55:41 2009
@@ -21,7 +21,6 @@
 
 import org.apache.xerces.dom.ElementImpl;
 import org.apache.xerces.dom.ProcessingInstructionImpl;
-import org.apache.xerces.dom.TextImpl;
 import org.w3c.dom.Node;
 import org.w3c.dom.html.HTMLDocument;
 import org.xml.sax.AttributeList;
@@ -173,7 +172,7 @@
     {
        if ( _current == null )
             throw new SAXException( "HTM009 State error: character data found 
outside of root element." );
-       _current.appendChild( new TextImpl( _document, text ) );
+        _current.appendChild( _document.createTextNode(text) );
     }
 
     
@@ -182,7 +181,7 @@
     {
        if ( _current == null )
             throw new SAXException( "HTM010 State error: character data found 
outside of root element." );
-       _current.appendChild( new TextImpl( _document, new String( text, start, 
length ) ) );
+        _current.appendChild( _document.createTextNode(new String(text, start, 
length)) );
     }
     
     
@@ -190,7 +189,7 @@
         throws SAXException
     {        
         if ( ! _ignoreWhitespace )
-           _current.appendChild( new TextImpl( _document, new String( text, 
start, length ) ) );
+            _current.appendChild( _document.createTextNode(new String(text, 
start, length)) );
      }
     
     
@@ -207,9 +206,9 @@
        }
        else
         if ( _current == null && _document != null )
-           _document.appendChild( new ProcessingInstructionImpl( _document, 
target, instruction ) );
+            _document.appendChild( 
_document.createProcessingInstruction(target, instruction) );
        else
-           _current.appendChild( new ProcessingInstructionImpl( _document, 
target, instruction ) );
+        _current.appendChild( _document.createProcessingInstruction(target, 
instruction) );
     }
     
     



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to