You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Becker <jo...@hotmail.com> on 2003/10/27 19:52:25 UTC

WoodyBinding and form2xml.flow-example question

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".

But now I get following error:
____________________________________________________________________________
An Error Occurred
"resource://org/apache/cocoon/woody/flow/javascript/woody2.js", line 199: 
uncaught JavaScript exception: at form2xml 
(file:/C:/Programme/cocoon-2.1.2/build/webapp/samples/woody/flow/binding_example.js, 
Line 73) at (resource://org/apache/cocoon/woody/flow/javascript/woody2.js, 
Line 199): org.apache.commons.jxpath.JXPathException: Exception trying to 
create xpath contact[3]; Factory could not create a child node for path: 
/data[1]/wrapper[1]/context[1]/contacts[1]/contact[3]
org.apache.avalon.framework.CascadingRuntimeException: 
"resource://org/apache/cocoon/woody/flow/javascript/woody2.js", line 199: 
uncaught JavaScript exception: at form2xml 
(file:/C:/Programme/cocoon-2.1.2/build/webapp/samples/woody/flow/binding_example.js, 
Line 73) at (resource://org/apache/cocoon/woody/flow/javascript/woody2.js, 
Line 199): org.apache.commons.jxpath.JXPathException: Exception trying to 
create xpath contact[3]; Factory could not create a child node for path: 
/data[1]/wrapper[1]/context[1]/contacts[1]/contact[3]
cause: org.apache.commons.jxpath.JXPathException: Exception trying to create 
xpath contact[3]; Factory could not create a child node for path: 
/data[1]/wrapper[1]/context[1]/contacts[1]/contact[3]
full exception chain stacktrace[hide]
Original Exception: org.apache.commons.jxpath.JXPathException: Exception 
trying to create xpath contact[3]; Factory could not create a child node for 
path: /data[1]/wrapper[1]/context[1]/contacts[1]/contact[3]

	at 
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:420)
_______________________________________

What did I understand wrong?

Thanks Jonny

_________________________________________________________________
E-Mails sind zu unpersönlich? Mit einer Webcam wird der MSN Messenger zum 
Bildtelefon! http://messenger.msn.de Jetzt kostenlos downloaden und der Spaß 
beginnt!


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


Re: WoodyBinding and form2xml.flow-example question

Posted by Bruno Dumon <br...@outerthought.org>.
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