cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [cforms] New Repeater Binding Semantics (was Re: CocoonForms simple-repeater binding sample?)
Date Fri, 05 Dec 2003 13:12:12 GMT
Marc Portier wrote:

> Timothy Larson wrote:
>> --- Marc Portier <> wrote:
>>> Timothy,
>>> the rudimentary dox (see wiki) on the simple-repeater-binding are 
>>> explaining this:
>>> It is currently only supporting binding back to XML (so I suspect 
>>> that you were testing versus a java beans backend model here?)
>> I was attempting and failing to bind to an XML document.  The load 
>> worked, but the save gave the exception.
> Sylvain?
> I know Sylvain created this:

> exactly to cater for the automatic creation (factory) of DOMNodes 
> triggered from jxpath createPath statements...
> But I have to admit I can't find where that thingy gets registered on 
> the jxpath context (too much relying on the advanced search of eclipse?)

Sorry, I'm very late on all this.

Actually, there's currently no use of this class in Cocoon samples, but 
I use it on my projects. Here's how: in the flow, I don't load/save the 
DOM directly, but through a JXPathContext as follows;

  var doc = readDocument(url);
  var bindingCtx = createBindingContext(doc);

And here's the createBindingContext function:

function createBindingContext(document) {
   // Create a JXPath context on the document.
   var xpathContext =;
   // Set it to lenient
   // Add the necessary factory create elements and attributes as needed 
on non-existing paths
   return xpathContext;

Having to explain how this work yesterday during a training, I felt that 
it should be better hidden in the binding machinery, since this is 
somehow needed every time we bind a form do a DOM (unless the DOM 
already contains the whole XML structure).

So what about adding this into the AbstractJXPathBinding: if the object 
passed to load/save is a Node, then add the DOMFactory automatically.


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -

View raw message