cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Larson <timlarsonw...@yahoo.com>
Subject Re: [cforms] add lenient setting to context binding
Date Fri, 19 Dec 2003 14:51:18 GMT
In JXPathBindingBase.java, was this line removed on purpose:
    jxpc.setFactory(new DOMFactory());

Perhaps this is the cause of this users's continuing problems:
  http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=107176523405519&w=2

Should it be added to makeJXPathContext() like this:
    private JXPathContext makeJXPathContext(Object objModel) {
        JXPathContext jxpc;
        if (!(objModel instanceof JXPathContext)) {
            jxpc = JXPathContext.newContext(objModel);
            jxpc.setLenient(true);
            //-- Add the following two lines ---
            if (objModel instanceof Node)
              jxpc.setFactory(new DOMFactory());
            //----------------------------------
        } else {
            jxpc = (JXPathContext) objModel;            
        }
        return jxpc;
    }

For reference, this snippet in revision 1.5:
    JXPathContext jxpc; 
    if (!(objModel instanceof JXPathContext)) {
        jxpc = JXPathContext.newContext(objModel);

        if (objModel instanceof Node) {
            jxpc.setFactory(new DOMFactory());
        }
    } else {
        jxpc = (JXPathContext) objModel;
    }

was changed to this in revision 1.6:
    JXPathContext jxpc = makeJXPathContext(objModel);

WDTY?

--Tim Larson


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Mime
View raw message