cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Duroc" <nicolas.du...@gmail.com>
Subject Re: Insert-Node and "deep" XML structure
Date Fri, 29 Sep 2006 10:41:09 GMT
I just tried your solution, but there is still not the "classement" node.
It may be normal with your solution because, there isn't a "addClassement"
button with a "add-row" action. It could be a solution, but I would like the
"classement" node be transparent for the user. He add a "niveau", and he
just have to add "concurrent" node after...

Is it possible or the "addClassement" button is the only way ?

2006/9/29, Jeroen Reijn <j.reijn@hippo.nl>:

> Hi Nicolas,
>
> you should not put fb:tags inside your <fb:insert-node/>. The
> <fb:insert-node/> will put all it's child nodes into the DOM object and
> they will then of course appear in the resulting XML document.
>
> You need to make sure the hierarchy of you document is correct.
> So what happens if you do it like this with the classment insert node in
> between?
>
>   <fb:repeater id="niveaux" parent-path="." row-path="niveau">
>     <fb:on-bind>
>       <fb:repeater id="classements" parent-path="." row-path="classement">
>         <fb:on-bind>
>           <fb:repeater id="concurrents" parent-path="."
> row-path="concurrent">
>             <fb:on-insert-row>
>               <fb:insert-node>
>                 <concurrent>
>                   <nom/>
>                 </concurrent>
>               </fb:insert-node>
>             </fb:on-insert-row>
>           </fb:repeater>
>         </fb:on-bind>
>         <fb:on-insert-row>
>           <fb:insert-node>
>             <classement> </classement>
>           </fb:insert-node>
>         </fb:on-insert-row>
>       </fb:repeater>
>     </fb:on-bind>
>     <fb:on-insert-row>
>       <fb:insert-node>
>         <niveau>
>           <libelle/>
>           <classement> </classement>
>         </niveau>
>       </fb:insert-node>
>     </fb:on-insert-row>
>   </fb:repeater>
>
> Reijn
>
>
>
>
> Nicolas Duroc wrote:
> > Hi Jeroen,
> >
> > Thanks for your response, in fact, when I insert many
> > <fb:insert-node>...</fb:insert-node>, they still are in the XML document
> > instead of inserting a "real" node.
> >
> > If I try this :
> >
> > </fb:repeater>
> >       </fb:on-bind>
> >         <fb:on-insert-row>
> >             <fb:insert-node>
> >                 <niveau>
> >                     <libelle>
> >                     <fb:insert-node>
> >                         <classement>
> >                         </classement>
> >                     </fb:insert-node>
> >                 </niveau>
> >             </fb:insert-node>
> >         </fb:on-insert-row>
> >  </fb:repeater>
> >
> > Here's what I get in the XML document when it's saved :
> >
> > <niveau>
> >     <libelle>test</libelle>
> >     <fb:insert-node xmlns:fb="http://apache.org/cocoon/forms/1.0#binding
> ">
> >         <classement>
> >             <concurrent/>
> >         </classement>
> >     </fb:insert-node>
> > </niveau>
> >
> > I don't want that the <fb:insert-node> appear in the XML document.
> >
> > Regards,
> >
> > Nicolas
> >
> >
> > 2006/9/29, Jeroen Reijn <j.reijn@hippo.nl <mailto:j.reijn@hippo.nl>>:
> >
> >     Hi Nicolas,
> >
> >     I will try to help you out.
> >
> >     Nicolas Duroc wrote:
> >      > Hello,
> >      >
> >      > I have some problem about inserting nodes in my XML document. In
> >     fact my
> >      > document has the following structure :
> >      >
> >      > <root>
> >      >     <niveau>
> >      >         <classement>
> >      >             <concurrent>
> >      >                 <nom>test</nom>
> >      >             </concurrent>
> >      >             ...
> >      >         </classement>
> >      >     </niveau>
> >      >     ...
> >      > </root>
> >      >
> >      > I use the "on-insert-row" action to insert "concurrent", but when
> >     I want
> >      > to insert a "niveau", I would like ton insert the associated
> >      > "classement" like :
> >      >
> >      > <niveau>
> >      >     <classement/>
> >      > </niveau>
> >
> >     Ok well this seems pretty logical to me.
> >
> >      >
> >      > By this way, I could add "concurrent" in this "classement".
> >     Although I
> >      > specified, the inserted node with a "2 level deep", it inserts
> >     only the
> >      > "niveau", and I can't insert "concurrent" in it.
> >
> >     Hmm this seems strange to me, so this is where the problem lies.
> >
> >      >
> >      > here's my binding file :
> >     <snip/>
> >      >
> >      > To insert a deeper "node", I suppose I have to add many
> >     "insert-node"
> >      > but when I try, tags aren't interpreted, and they appear in the
> >     XML File...
> >
> >     What do you mean exactly with tags aren't interpreted. You don't see
> >     them inside your form?
> >
> >     What happens if you save the file, do the XML tags end up in your
> >     resulting XML document?
> >
> >      >
> >      > If anyone has an idea...
> >      >
> >     Ciao,
> >
> >     Jeroen Reijn
> >     Hippo
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >     <mailto:users-unsubscribe@cocoon.apache.org>
> >     For additional commands, e-mail: users-help@cocoon.apache.org
> >     <mailto:users-help@cocoon.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