<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
The code you have here seems fine. Here is the test that I tried earlier and it passed:<BR>
<BR>
<TT>public void testAddJDOMElements() throws Exception {<BR>
                String[] act = {"one", "two", "three", "four"};<BR>
                Element element= new Element("ActivitySummary");<BR>
                for (int j = 0; j <act.length; j++) {<BR>
                         Element element1= new Element("ActivityType").setText(act[j]);<BR>
                         element.addContent(element1);<BR>
                }<BR>
                <BR>
                List element1s = element.getChildren();<BR>
                assertEquals(4, element1s.size());<BR>
                <BR>
                for(int i=0; i<element1s.size(); i++) {<BR>
                         System.out.println(((Element) element1s.get(i)).getText());<BR>
                }<BR>
}</TT><BR>
<BR>
Could it be something you do when you retrieve the elements? When does the problem manifest itself? Are you sure that "act" array is populated correctly?<BR>
<BR>
Best regards<BR>
<BR>
Ben<BR>
<BR>
<BR>
On Wed, 2003-12-10 at 13:10, Moipone Mocoancoeng wrote:
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#737373"><I>How do I create an element that has an unbounded maximum occurences.<BR>
for examples I've created an element that I need to set text to an object that can be 1 0r more.When I do element.addContent only the first object is added to the one element and other object aren't added.<BR>
<BR>
Element element= new Element("ActivitySummary");<BR>
for (int j = 0; j <act.length; j++){<BR>
Element element1= new Element("ActivityType").setText(act[j]);<BR>
element.addContent(element1);<BR>
}<BR>
Please Advise on how best can I resolve this problem.<BR>
Best Regards<BR>
<BR>
<BR>
<HR SIZE="1">
Do you Yahoo!?</FONT><BR>
<A HREF="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=21260/*http://photos.yahoo.com"><U>New Yahoo! Photos - easier uploading and sharing</U></I></A>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>--
benjamin kopic
m: +44 (0)780 154 7643
t: +44 (0)20 7794 3090
e: benjamin.kopic@panContext.com
w: http://www.panContext.com/</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>