You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hans-Guenter Stein <Ha...@siteos.de> on 2000/07/27 09:46:27 UTC

inserting a fragment

Could anyone give me a hint on how to insert a DocumentFragment at a
specific position in a document. the code looks like:

<xsp:page>
 <xsp:logic>
  <!-- get the first part of the document -->
  DocumentFragment frag = myMethod.getDocFrag("Fragement1");
  <!-- insert it into the page -->
  xspCurrentNode.appendChild(frag);
  <!-- get the second part of the document -->
  frag = myMethod.getDocFrag("Fragement2");
  <!-- NOW: how to insert the second fragment at a specific position
within the first one??? -->
  ???
 </xsp:logic>
</xsp:page>


Re: inserting a fragment

Posted by tc...@dff.st.
> Could anyone give me a hint on how to insert a DocumentFragment at a
> specific position in a document. the code looks like:
> 
> <xsp:page>
>  <xsp:logic>
>   <!-- get the first part of the document -->
>   DocumentFragment frag = myMethod.getDocFrag("Fragement1");
>   <!-- insert it into the page -->
>   xspCurrentNode.appendChild(frag);
>   <!-- get the second part of the document -->
>   frag = myMethod.getDocFrag("Fragement2");
>   <!-- NOW: how to insert the second fragment at a specific position
> within the first one??? -->
>   ???
>  </xsp:logic>
> </xsp:page>

Well, you have a the fragment... you should be able to
access a node within your "frag" and call appendChild
on that. (I guess ;-)
--
Torsten