Carla,

Thanks, that was part of the problem - I thought I'd overlooked
something. But there still is a bug in 

org.apache.xerces.dom.DOMConfigurationImpl.setParameter(String name,
Object value).

The error is in the first two lines:

 if (value == Boolean.TRUE || value == Boolean.FALSE) {
     boolean state = (value == Boolean.TRUE) ? true : false;
     .
     .
     .
Since the value argument is a Boolean _Object_ and not a primitive, the
== operator compares identity of objects, not equivalence of Boolean
value. Since I pass a Boolean Object that is freshly allocated
(actually, I don't but the Jython runtime does), the == is not satisfied
and the code drops through to the default, FEATURE_NOT_FOUND. The check
should be done the same way the name check is done, viz.

 if (value.equals(Boolean.TRUE) || value.equals(Boolean.FALSE) {
     boolean state = (value.equals(Boolean.TRUE) ? true : false;
     .
     .
     .

Thanks again. Now to see if I can work around it in the meantime.
 

CTDay

-----Original Message-----
From: Carla Spruit [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2003 12:40 AM
To: [EMAIL PROTECTED]




Hi,

The current DOMConfiguration functions do not support primitive data
types:

public interface DOMConfiguration {
    public void setParameter(String name, 
                             Object value)
                             throws DOMException;

    public Object getParameter(String name)
                               throws DOMException;

    public boolean canSetParameter(String name, 
                                   Object value);
}


The following code should give a better result:

documentConfig.canSetParameter("validate", Boolean.TRUE) 
documentConfig.setParameter("validate", Boolean.TRUE) 

Carla



> -----Original Message-----


I'm trying to follow the recipe in
http://xml.apache.org/xerces2-j/faq-dom.html#faq-7 but I don't seem to
be able to set the "validate" parameter on the DOMConfiguration object.
In particular, 

 

documentConfig.getParameter("validate") returns false,

documentConfig.canSetParameter("validate", true) returns false,

documentConfig.setParameter("validate", true) throws a FEATURE_NOT_FOUND
exception.

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




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

Reply via email to