Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] Strange Element.addContent(index,Content) problem

Bradley S. Huffman

2004-03-22


Use getContent instead of getChildren. getChildren gives a list of *only*
the element children.

Brad

Kai Woerner writes:

> I'm experiencing a very odd problem with
> Element.addContent(index,Content). This is an altered snipplet from the
> code I have:
>
> elmt.addContent(440, newComm);
> System.out.println("@(protected)));
>
> (elmt being a legal element in a jdom-tree, newComm being a new Element)
>
> - this would output "inserted at: 220".
>
> Of course the code is a bit longer and more complicated, but these two
> lines are exactly like in my code and the result is alwayy the same:
> elmt.addContent(200, newComm) would result in 100.
>
> Anybody having experienced something like that?
>
> Thanks,
>
> Kai W�rner
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
> .com
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.