cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding JXPathBindingBase.java
Date Sat, 20 Dec 2003 14:54:03 GMT
mpo         2003/12/20 06:54:03

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
                        JXPathBindingBase.java
  Log:
  Fixing the clumsy removal of the automatic registration 
  of the DOMFactory for XML backends. 
  (introduced in 1.5 and wrongfully removed in 1.7)
  
  Revision  Changes    Path
  1.7       +6 -1      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/JXPathBindingBase.java
  
  Index: JXPathBindingBase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/JXPathBindingBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JXPathBindingBase.java	18 Dec 2003 07:57:21 -0000	1.6
  +++ JXPathBindingBase.java	20 Dec 2003 14:54:03 -0000	1.7
  @@ -52,8 +52,10 @@
   
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.cocoon.util.jxpath.DOMFactory;
   import org.apache.cocoon.woody.formmodel.Widget;
   import org.apache.commons.jxpath.JXPathContext;
  +import org.w3c.dom.Node;
   
   /**
    * Provides a base class for hooking up Binding implementations that use the 
  @@ -158,8 +160,11 @@
           if (!(objModel instanceof JXPathContext)) {
               jxpc = JXPathContext.newContext(objModel);
               jxpc.setLenient(true);
  +            if (objModel instanceof Node) {
  +                jxpc.setFactory(new DOMFactory());
  +            }
           } else {
  -            jxpc = (JXPathContext) objModel;            
  +            jxpc = (JXPathContext) objModel;
           }
           return jxpc;
       }
  
  
  

Mime
View raw message