You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by le...@locus.apache.org on 2000/02/21 19:37:13 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/dom NodeContainer.java

lehors      00/02/21 10:37:13

  Modified:    java/src/org/apache/xerces/dom NodeContainer.java
  Log:
  change to cope with the fact that ownerDocument is null for
  a DocumentType node that was created from DOMImplementation and not used
  with any Document yet
  
  Revision  Changes    Path
  1.5       +6 -3      xml-xerces/java/src/org/apache/xerces/dom/NodeContainer.java
  
  Index: NodeContainer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/NodeContainer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NodeContainer.java	2000/02/05 02:23:03	1.4
  +++ NodeContainer.java	2000/02/21 18:37:12	1.5
  @@ -1,4 +1,4 @@
  -/* $Id: NodeContainer.java,v 1.4 2000/02/05 02:23:03 lehors Exp $ */
  +/* $Id: NodeContainer.java,v 1.5 2000/02/21 18:37:12 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    *
  @@ -333,7 +333,8 @@
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
        	
  -        boolean errorChecking = ownerDocument.errorChecking;
  +        boolean errorChecking =
  +	    (ownerDocument != null) ? ownerDocument.errorChecking : true;
       	if(errorChecking && !(newChild instanceof NodeImpl)
       		||
       		!(
  @@ -405,7 +406,9 @@
               }
       	}
       	
  -    	else if (errorChecking && !ownerDocument.isKidOK(this, newInternal)) {
  +    	else if (errorChecking &&
  +		 (ownerDocument != null &&
  +		  !ownerDocument.isKidOK(this, newInternal))) {
       		throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
       		                           "DOM006 Hierarchy request error");
           }