Hi Chris,

You do need to have a particular class associated with your top-level 
element, in this case the <people> element. If this <people> element 
were instead embedded inside some other XML you could avoid this, by 
just using a <collection> element in your binding definition that 
references the field holding the list and has an embedded <structure> 
defining the Person class binding.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Chris wrote:
> I have the following XML:
>
> <people>
>   <person first="john" last="doe"/>
>   <person first="jane" last="doe"/>
> </people>
>
> I have a Person class, and I would like to map this
> XML to a Collection of People instances. Is this
> possible?
>
> My quick and easy solution was to create a PeopleList
> class that had one member of type List and mapped
> <people> to PeopleList. The PeopleList class serves no
> other purpose other than to allow for JiBX mapping and
> I was hoping I could do without it.
>
> Thanks,
> Chris
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to