Hi Karl,

Writing a top-level array is probably not a good idea unless your xml
document is simply going to be a fragment. XML documents can only have
one top-level element. 

You might want to try something like the following:

public class MyData {

     
   private Object[] _data = null;

   public MyData() {
      //-- default constructor
   }

   public MyData(Object[] data) {
      _data = data;
   }

   public Object[] getData() {
      return _data;
   } 

   public void setData(Object[] data) {
      _data = data;
   } 

}

And then marshal an instance of MyData....

marshaller.marshal(new MyData(myArray));

I hope that works for you.

--Keith

"Baum, Karl" wrote:
> 
> I am trying to write an array of bean objects to an xml file.  I do not care
> much about the format of the xml file as long as the data is present and the
> objects can be read back into memory by using the xml file.  When I output
> the objects to a file, the output is  just a top level Array object with no
> data present.  Is there something I need to specify in the mapping file to
> simply write an array of bean objects?  Any help would be greatly
> appreciated.  Thanks.
> 
> Karl
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to