You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Ulrich, Dominik" <Do...@ids.de> on 2003/11/13 14:33:32 UTC

[woody binding] insert attribute content into similar nodes

Hi everybody
it's a rather complicated woody question I have, at least for me :)

I have a data xml file like this:

<context>
	<element title="A" value="true"/>
	<element title="B" value="false"/>
</context>

now I want to bind the value of a boolean widget to these elements in @value.
problem: the binding must insert one value to one element with attribute content "A"
 and insert another value to the other element with "B" inside.

both nodes have the same names, so what should I do?
the binding file must choose the element based on his attribute, so how can I do this?

thanks for your help!

ciao
dominik

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


Re: [woody binding] insert attribute content into similar nodes

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2003-11-13 at 14:33, Ulrich, Dominik wrote:
> Hi everybody
> it's a rather complicated woody question I have, at least for me :)
> 
> I have a data xml file like this:
> 
> <context>
> 	<element title="A" value="true"/>
> 	<element title="B" value="false"/>
> </context>
> 
> now I want to bind the value of a boolean widget to these elements in @value.
> problem: the binding must insert one value to one element with attribute content "A"
>  and insert another value to the other element with "B" inside.
> 
> both nodes have the same names, so what should I do?
> the binding file must choose the element based on his attribute, so how can I do this?

I think this should work:

<wb:value id="mywidget1" path="element[@title='A']/@value"/>
<wb:value id="mywidget2" path="element[@title='B']/@value"/>

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