[jdom-interest] why can't the Text be added to a List?

Jason Hunter jhunter at acm.org
Thu Apr 10 14:31:38 PDT 2003


If you're calling getMixedContent() then you're not using the latest
code.  That method hasn't been around for a long time.  Text is a new
class.  You're mixing old and new.

-jh-

> Eugene Wong wrote:
> 
> Hi,
> 
> I got a problem when using trying to manipulate the content of an
> Element node. I tried to insert some new text into certain position in
> the list of content owned by an element object, called e. That's what
> I want to, as shown below.
> 
> List children = e.getMixedContent();
> children.add(0, new Text("haha");
> 
> Then what I get is an IllegalAddException. It seems that I cannot
> insert a Text object into the List.
> 
> How can I solve this problem, and how can I add text content into the
> List?
> 
> Thanks
> 
> Regards,
> Eugene
>



More information about the jdom-interest mailing list