public void replaceData(int offset,int count,String data) throws DOMException {
  CoreDocumentImpl ownerDocument=ownerDocument();
  if (ownerDocument.errorChecking && isReadOnly()) {
    String msg=DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,"NO_MODIFICATION_ALLOWED_ERR",null);
    throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,msg);
  }
  if (needsSyncData()) {
    synchronizeData();
  }
  ownerDocument.replacingData(this);
  String oldvalue=this.data;
  internalDeleteData(offset,count,true);
  internalInsertData(offset,data,true);
  ownerDocument.replacedCharacterData(this,oldvalue,this.data);
}

public void replaceData ( int offset , int count , String data ) throws DOMException { CoreDocumentImpl ownerDocument = ownerDocument ( ) ; if ( ownerDocument . errorChecking && isReadOnly ( ) ) { String msg = DOMMessageFormatter . formatMessage ( DOMMessageFormatter . DOM_DOMAIN , "NO_MODIFICATION_ALLOWED_ERR" , null ) ; throw new DOMException ( DOMException . NO_MODIFICATION_ALLOWED_ERR , msg ) ; } if ( needsSyncData ( ) ) { synchronizeData ( ) ; } ownerDocument . replacingData ( this ) ; String oldvalue = this . data ; internalDeleteData ( offset , count , true ) ; internalInsertData ( offset , data , true ) ; ownerDocument . replacedCharacterData ( this , oldvalue , this . data ) ; }
replace a series of characters at the specified ( zero - based ) offset with a new string , not necessarily of the same length . convenience method , equivalent to a delete followed by an insert . throws a domexception if the specified offset is beyond the end of the existing data .
