neeraj      2003/10/31 03:39:33

  Modified:    java/src/org/apache/xerces/dom CoreDocumentImpl.java
  Log:
  Since entity & notation are readonly nodes, NO_MODIFICATION_ALLOWED_ERR should
  be thrown. Changing the code accordingly.
  
  Revision  Changes    Path
  1.48      +10 -4     xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java
  
  Index: CoreDocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- CoreDocumentImpl.java     31 Oct 2003 11:32:04 -0000      1.47
  +++ CoreDocumentImpl.java     31 Oct 2003 11:39:33 -0000      1.48
  @@ -1625,11 +1625,17 @@
                   attr.setOwnerDocument(this);
                   break;
               }
  -            //document, entity, notation, documentype nodes can't be adopted.
  +            //entity, notation nodes are read only nodes.. so they can't be adopted.
  +            //runtime will fall through to NOTATION_NODE
  +            case ENTITY_NODE:
  +            case NOTATION_NODE:{
  +                String msg = 
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, 
"NO_MODIFICATION_ALLOWED_ERR", null);
  +                throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, 
msg);
  +
  +            }
  +            //document, documentype nodes can't be adopted.
               //runtime will fall through to DocumentTypeNode
               case DOCUMENT_NODE:
  -            case ENTITY_NODE:
  -            case NOTATION_NODE:
               case DOCUMENT_TYPE_NODE: {
                   String msg = 
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", 
null);
                   throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to