cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <>
Subject Re: Woody binding to incomplete XML documents
Date Mon, 08 Sep 2003 19:30:52 GMT

just saw the commit fly by
looks good,
this covers already much of the lenient stuff if I interpret this correctly

thx for doing this already, my planning is drifting anyway...

Sylvain Wallez wrote:
> Hi,
> I'm using Woody to modify data in an XML document and encountered a lot 
> of binding problems because the document is initially incomplete (not 
> all elements are present).
> 1/ Loading a form fails with a freshly created document because some 
> elements don't exist. A solution to this is to make the JXPathContext 
> lenient (IIRC, Marc proposed it some time ago) so that binding doesn't 
> fail if a path doesn't exist.
> 2/ The same reasons (non-existent elements) lead the saving to fail. The 
> solution is to use createPathAndSetValue() instead of just setValue(). 
> In the general case, this will also fail unless a JXPath AbstractFactory 
> is provided to the JXPathContext. I wrote one for DOM elements.

this is why I mentioned the possibility for adding maybe some 
insert-node for value-binding in case it would need to create stuff

so if I read this right you are saying here that for DOM stuff this will 
just create elements and textnodes to comply to the paths specified?

> 3/ When a field value is null, I would like the corresponding path to be 
> deleted rather than setting its value to null. This will remove elements 
> rather than emptying them. Should this be configurable (i.e. 
> delete-on-null="true") ? Note that this only impacts DOM bindings since 
> deleting on JavaBeans is exactly the same as setting the value to null 
> (the property cannot be removed from the class!).
> How does this sound ?
> Ah, and some additional goodies I wrote (need a bit testing before 
> committing) :
> - a simple binding for repeaters that deletes all values before 
> re-adding them. This avoids the need for unique row-ids as required by 
> the current repeater binding.

another one removed from my todo list ;-)
guess it wasn't itching enough on my side yet...

> - a stylesheet to generate the binding from <wd:binding> elements and 
> wb:* attributes in the form definition. Very convenient, as it avoids 
> the need for a separate binding file.

here here!
(however: did I miss this in the commitmails?)

> Sylvain

-marc= (on hard working course week with limited online time)
Marc Portier                  
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                        

View raw message