You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kirk Woerner <ki...@stoneseeker.com> on 2000/11/17 17:24:08 UTC

FP:taglib how to insert down a hierarchy?

I have an xml structre like this

<Root>
  <item id="i1">
    <thing id="t1">  other element stuff </thing>
    <thing id="t2">  other element stuff </thing>
  <item>
  <item id="i2">
    <thing id="t1">  other element stuff </thing>
  </item>
</Root>

Now, I'm making an FP page to edit "things".  I'call this page
"itemthing.xml".  I pass in the ids of the things I want to
edit, like so
http://myhost/itemthing.xml?item_id=i1&thing_id=t1.

This works great when I'm editing an existing element because
as from the sample included in cocoon I set a couple variables
in xsp and just say the fp:write element is
"/Root/item[@id=<xsp:expr>item_id</xsp:exprt>]/item[@id=<xsp:expr>thing_id
</xsp:expr>"

Now the problem.  I'd like to be able to automatically add elments to
this file. So given the above file, if I call
http://myhost/itemthing.xml?item_id=i3&thing_id=t1

I would want a new element
   <item id="i3">
      <thing id="t1"> stuff </thing>
   </item>

Likewise, if I said
http://myhost/itemthing.xml?item_id=i2&thing_id=t9

it would add a new item element to the EXISTING <item id="i2">
element.

So, question - can this be done directly using FP?  If not, can
I do it somehow in DOM in the XSP page and still use FP for
everything else.  That is, can I do the element add and still
bind FP to that element for editing?

Thanks for the help...
Kirk

Re: FP:taglib how to insert down a hierarchy?

Posted by Ulrich Mayring <ul...@denic.de>.
Kirk Woerner wrote:
> 
> Now the problem.  I'd like to be able to automatically add elments to
> this file. So given the above file, if I call
> http://myhost/itemthing.xml?item_id=i3&thing_id=t1

There have been various reports about this problem, I think it will be
fixed in the next release of the fp taglib. In the meantime there's not
much you can do about it (except fix the bug ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung