Ok, I've managed to jibx comiple my mapping definition. Marshaling is also
working, but only for 1 iteration of the collection. As soon as I iterate
more than once, an exception is thrown; "org.jibx.runtime.JiBXException:
Collection item of type Type1 has no binding defined".
my binding now looks somthing like:
</binding>
<mapping name="e1" class="Type1">
<value field="value" style="text" usage="required"/>
</mapping>
<mapping name="e2" class="Type2">
<value field="value" style="text" usage="required"/>
</mapping>
<mapping name="e3" class="Type3">
<value field="value" style="text" usage="optional"/>
</mapping>
<structure name="someElement" field="someElement" usage="optional"
type="SomeElement">
<collection field="children" factory="SomeElement.listFactory"
usage="optional">
<structure type="Type1" usage="required"/>
<structure type="Type2" usage="required"/>
<structure type="Type3" usage="optional"/>
</collection>
</structure>
</binding>
P.S. One thing is confusing with this error, especially with more than two
iterations; it seems that the exception is only thrown on the first element
of the last iteration.
Has anyone out there had the same problem?
Thanks
Jorge
Quecas wrote:
>
> Hi all,
>
> I have just started using jibx since I would like to (possibly) change
> from
> jaxb.
>
> I am having difficulty defining a mapping to correspond to a customers
> schema, especially a collection to a sequence that houses repeating
> elements, e.g.
> <root>
> <someElement>
> <e1>aaa</e1> (required)
> <e2>bbb</e2> (required)
> <e3>ccc</e3> (optional)
> <e1>ddd</e1> (required)
> <e2>eee</e2> (required)
> <e1>fff</e1> (required)
> <e2>ggg</e2> (required)
> <e3>hhh</e3> (optional)
> </someElement>
> </root>
>
> I have spent hours trying to get a mapping definitions that works, but to
> no
> avail - could someone please point me in the right direction.
>
> Thanks
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
--
View this message in context:
http://www.nabble.com/Collection-difficulty-tp19666104p19672548.html
Sent from the jibx-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users