[jdom-interest] setcontent and removecontent methods

A S sharan at lycos.com
Wed Oct 15 21:11:56 PDT 2003


Hi,

I am facing the following problem related to manipulating the content of an element.


Basically, I have element A, i want to take its content and add it as the content of element B.
However, I am not able to do that right now 

briefly,

org.jdom.Element cloneElement= (org.jdom.Element)element.clone();
cloneElement.detach();
element.setContent(null);
 org.jdom.Element spanElement= new org.jdom.Element("span"); 
java.util.List clist=cloneElement.getContent();
logger.info("got children list from clone , size "+ clist.size() );
spanElement.setContent(clist);

this throws an exception





____________________________________________________________
Enter for a chance to win one year's supply of allergy relief!
http://r.hotbot.com/r/lmt_clrtn/http://mocda3.com/1/c/563632/125699/307982/307982



More information about the jdom-interest mailing list