Good question, Joshua. The only difference between the two forms is that 
the second allows you to mix other types of values in the same 
collection (so you could have java.lang.Integer, for instance, and use a 
different element name for these values as opposed to the String 
values). If you don't need this flexibility, I think the first approach 
is cleaner.

  - Dennis

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



Davies, Joshua wrote:
> I'm in the process of upgrading from jibx beta 3c to 1.1.  We deal with
> a lot of collections of strings (in other words, the text values of
> repeating XML elements should be mapped to ArrayLists whose elements are
> all of type string).  We used to be able to get away with a binding like
> this:
>
> <collection field="targetList">
>   <value style="element" name="elementName" />
> </collection>
>
> And Jibx would assume type "string" for us.  Apparently jibx 1.1 is
> stricter (which is probably a good thing), but it appears that both of
> these work:
>
> <collection field="targetList" item-type="java.lang.String">
>   <value style="element" name="elementName" />
> </collection>
>
> or
>
> <collection field="targetList">
>   <value style="element" name="elementName" type="java.lang.String" />
> </collection>
>
> and, as far as I can tell, both seem to accomplish the same thing.  Is
> there any difference between the two, or any reason to prefer one form
> over the other?
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to