DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27750>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27750

Allow 'error-handler', 'resource-resolver' parameters to be set with null value

           Summary: Allow 'error-handler', 'resource-resolver' parameters to
                    be set with null value
           Product: Xerces2-J
           Version: 2.6.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


TYPE_MISMATCH_ERR should not be thrown when attempting to set domConfiguration 
parameters 'error-handler' or 'resource-resolver' to null in LSParser's 
domConfig object or on DOMConfig objects attached to the document. Spec states 
that setting a parameter to null should unset the parameter.  Currently failing 
DOM L3 Core test cases domconfigerrorhandler1 and 2 as a result.

Patch in DOMConfigurationImpl.setParameter:

--- C:\xml-xerces\java\src\org\apache\xerces\dom\DOMConfigurationImpl.java 2004-
03-17 12:06:07.00 -0500  1.25
+++ C:\xerces-temp\DOMConfigurationImpl.java    2004-03-16 18:00:10.00 -0
500
@@ -605,7 +605,7 @@
         }
         else { // set properties
             if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
-                if (value instanceof DOMErrorHandler) {
+                if (value instanceof DOMErrorHandler || (value==null)) {
                     fErrorHandlerWrapper.setErrorHandler((DOMErrorHandler)value
);
                     setErrorHandler(fErrorHandlerWrapper);
                 }
@@ -621,7 +621,7 @@
                 }
             }
             else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
-                if (value instanceof LSResourceResolver) {
+                if (value instanceof LSResourceResolver || (value==null)) {
                     try {
                         setEntityResolver(new DOMEntityResolverWrapper((LSResou
rceResolver) value));
                     }


Patch in DOMParserImpl.setParameter:

--- C:\xml-xerces\java\src\org\apache\xerces\parsers\DOMParserImpl.java 2004-03-
17 12:07:21.00 -0500  1.19
+++ C:\xerces-temp\DOMParserImpl.java   2004-03-17 12:00:45.00 -0500

@@ -411,8 +407,7 @@
         else { // set properties
             if (name.equalsIgnoreCase (Constants.DOM_ERROR_HANDLER)) {
                 // REVISIT: we should probably allow unsetting error-handler
-                if (value == null) return;
-                if (value instanceof DOMErrorHandler) {
+                if (value instanceof DOMErrorHandler || value==null) {
                     try {
                         fErrorHandler = new DOMErrorHandlerWrapper ((DOMErrorHa
ndler) value);
                         fConfiguration.setProperty (ERROR_HANDLER, fErrorHandle
r);
@@ -431,7 +426,7 @@

             }
             else if (name.equalsIgnoreCase (Constants.DOM_RESOURCE_RESOLVER)) {

-                if (value instanceof LSResourceResolver) {
+                if (value instanceof LSResourceResolver || value==null) {
                     try {
                         fConfiguration.setProperty (ENTITY_RESOLVER, new DOMEnt
ityResolverWrapper ((LSResourceResolver) value));
                     }

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

Reply via email to