cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: WoodyBinding and form2xml.flow-example question
Date Wed, 29 Oct 2003 08:17:02 GMT
On Mon, 2003-10-27 at 19:52, Johannes Becker wrote:
> Hi,
> 
> I wanted to try out and customize the WoodyBinding 
> (http://localhost:8888/samples/woody/form2xml.flow) example.
> 
> Because I want to write some xml in an existing xml-file I customized this 
> line in the code:
> old: <wb:insert-node>
> new: <wb:insert-node src="forms/datatry.xml" xpath="/document/tree">
> 
> What I understood from the wiki-documentation that src="existing external 
> source" and xpath="where to write it in the tree of the external source".

I think you're confused here: the wb:insert-node doesn't modify the file
referenced in the src attribute, and hence the xpath attribute also
doesn't specify where to write it in the external source (what would you
expect it to write there anyway?).

The purpose of wb:insert-node is to insert a new node in the DOM-tree
passed to the form.save(...) method, when a new row is added to a
repeater. The src attribute refers to a file to be used as a template
for what XML should be inserted. The xpath attribute can be used if you
only need a part of that file. Alternatively, you can also specify the
XML directly inline (as in the form2_bind_xml.xml sample).

After the wb:insert-node is executed, the wb:on-bind will also be
executed so that the inserted template XML can be updated with the
necessary values.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message