For a structure/mapping to be flexible, everything in it needs a name - that 
includes the collection.  So yes, it's correct that the collection element must 
have a name, and that if you remove the collection element JiBX will fail the 
binding.  That would appear to be correct behavior from what I know of 
JiBX/flexible.

The problem is that with the binding as currently written, there is no name for 
the value.

I.e.
<collection name="collection-name" field="collectionField">
    <value name="value-name" type="java.lang.String"/>
</collection>

Will result in
<collection-name>
  <value-name>First value</value-name>
  <value-name>Second value</value-name>
</collection-name>

While if you remove the name from the value element, you no longer have a 
definition that makes sense..


--
The cake is a lie!
_________________________________________________
DARIN CLARK  |  ext. 4212

-----Original Message-----
From: mazz_97 [mailto:mazz...@yahoo.com] 
Sent: Sunday, October 03, 2010 7:52 PM
To: jibx-users@lists.sourceforge.net
Subject: [jibx-users] how to use collection in a structure with flexible=true - 
[SPAM E3 : Header]

hello,
I need help setting up a collection in a structure where flexible=true

What is the proper way to do that?

<structurename="AAA"field="errorMessage"type="com.jibx.error"ordered="false"flexible="true"
 usage="optional">    <collectionname="AAAHHH"field="errors">        
<valuetype="java.lang.String"/>    </collection> 
The above code does not seem to work. If I move the name from the collection to 
the value field, I get a compilation error:Error: All child components must 
define element names for flexible='true'; on collection element
 
Any suggestions  or help will be greatly appreciated.
 
Thanks
 
 </structure>

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to