[jdom-interest] Unable to compile program -- addContent

Joseph Yin jyin at qualcomm.com
Mon Mar 29 17:21:35 PST 2004


Hi there:

I just got the JDOM b10 downloaded and realized that the Element class 
implements the Parent Interface.  I have the following codes that will not 
compile:

rootElement.addContent(new Element("Course").addContent("Math"));

Where the rootElement is already defined as the root element and I am 
trying to add another element called Course and apply it's content.

The error message I received is something like....
cannot resolve symbol
symbol  : method addContent (org.jdom.Parent)
location: class org.jdom.Element


If I break this one statement into the following then everything works:

Element course = new Element("Course");
course.addContent("Math");
rootElement.addContent(course);

The same one-liner code use to work in Beta 9 version.  Can anyone offer me 
some hints or possible fixes using Beta 10.

Best, Joseph
jyin at qualcomm.com

=====================================================================
Joseph C. Yin, MSBA (IS Auditing)               Location:       S-204A
Staff Programmer 
Analyst                                Phone#          (858) 651-0316
QUALCOMM 
Incorporated.                          Fax    #                (858) 658-1011
IT Product Development Services                 EMail : jyin at qualcomm.com
"TEAM - Together Everyone Accomplishes More"
==================================================  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040329/b2f0c7ad/attachment.htm


More information about the jdom-interest mailing list