[jdom-interest] insert

Laurent ROMEO romeo at agisphere.com
Thu Mar 22 08:08:42 PST 2001



Hi,

Personnally I do the following :

---------------------
// Getting mixed content
Element a = ...
Element c = ...
Element p = a.getParent();  // idem if you get the parent of b element !
java.util.List mixedContent  = p.getMixedContent(); // Get the mixed content of the
parent ( a and c belongs to this List )

// Preparing g
Element b = new Element();
b.addContent( "The middle" );

mixedContent.add( indexOf( c )  , b ); // Javadoc : "The list is live and
modifications to it affect the element's actual content"
------------------------------


Really cool, isn'it ?


Laurent ROMEO.


elephantwalker a écrit :

> don't know this for sure, but is there a way to "insert" and element in a
> particular order?
>
> if I have elements:
>
> <a>
>  the beginning
> </a>
> <c>
>  the end
> </c>
>
> And I would like to insert <b>the middle</b> in between <a> and <c>, how is
> it done?
>
> Regards,
>
> Elephantwalker
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

--
Laurent ROMEO
Directeur Applications
AGISphere
romeo at agisphere.com
(+33)1.47.45.99.99


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010322/59be415e/attachment.htm


More information about the jdom-interest mailing list