mrglavas 2004/11/04 13:57:47 Modified: java/src/org/apache/xerces/dom TextImpl.java Log: DOM Level 3 specifies an attribute called strictErrorChecking [1] which when set to false allows an implementation to not test every possible error case. Reducing the amount of checking performed when strictErrorChecking is false. This patch is thanks to Naela Nissar. [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Document3-strictErrorChecking Revision Changes Path 1.28 +16 -14 xml-xerces/java/src/org/apache/xerces/dom/TextImpl.java Index: TextImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/TextImpl.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- TextImpl.java 5 Oct 2004 17:12:51 -0000 1.27 +++ TextImpl.java 4 Nov 2004 21:57:46 -0000 1.28 @@ -217,19 +217,21 @@ } // make sure we can make the replacement - if (!canModifyPrev(this)) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, - DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NO_MODIFICATION_ALLOWED_ERR", null)); - } - - // make sure we can make the replacement - if (!canModifyNext(this)) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, - DOMMessageFormatter.formatMessage( - DOMMessageFormatter.DOM_DOMAIN, - "NO_MODIFICATION_ALLOWED_ERR", null)); + if (ownerDocument().errorChecking) { + if (!canModifyPrev(this)) { + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMMessageFormatter.formatMessage( + DOMMessageFormatter.DOM_DOMAIN, + "NO_MODIFICATION_ALLOWED_ERR", null)); + } + + // make sure we can make the replacement + if (!canModifyNext(this)) { + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMMessageFormatter.formatMessage( + DOMMessageFormatter.DOM_DOMAIN, + "NO_MODIFICATION_ALLOWED_ERR", null)); + } } //replace the text node
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]