Hi Dominik,
I think this should be fixed in the current CVS code. Setting
usage="optional" for a child of a collection was doing bizarre things in
some cases, and I realized that the way collections work means
everything is always implicitly optional anyway, so I now force
usage="required" for the child components of a collection. If you take
off the usage="optional" on the "inner" structure this should also work
with RC1.
- Dennis
Dominik Wei-Fieg wrote:
Sorry,
clicked the send button too early...
--
Dominik
--- Ursprüngliche Nachricht ---
Von: "Dominik Wei-Fieg" <[EMAIL PROTECTED]>
An: jibx-users@lists.sourceforge.net
Betreff: [jibx-users] (no subject)
Datum: Mon, 5 Dec 2005 11:54:19 +0100 (MET)
Hi *,
I am experiencing problems when I try to bind structures in collections
where all attributes the structure defines are optional, e. g.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE binding SYSTEM "binding.dtd">
<binding>
<mapping name="outer" class="com.ars_subtilior.test.jibx.Outer">
<value name="name" field="name" usage="optional"
style="attribute"/>
<collection
factory="com.ars_subtilior.test.jibx.Outer.createCollection"
field="items" usage="optional" ordered="false">
<structure name="inner"
type="com.ars_subtilior.test.jibx.Inner"
value-style="attribute" usage="optional">
<value name="name" usage="optional" field="name"/>
<value name="i" usage="optional" field="i" default="0"/>
<value name="woop" usage="optional" field="woop"/>
</structure>
</collection>
</mapping>
</binding>
When I unmarshal an xml file like the following:
<?xml version="1.0"?>
<outer name="outerName">
<inner name="innerName"/>
<inner/>
</outer>
only one Inner gets created but the collection (Outer.items) contains two
entries, the first one is the Inner that got created for <inner
name="innerName"/>, the second one is null.
Marshalling then leads to the following exception: Collection item of type
NULL has no binding defined
I have a zip file that contains everything that is needed to
reproduce the behaviour (it is an Eclipse project) but that attachment
would
exceed the allowed mail size for the list.
The problem arises with RC 0 and RC 1.
Can anyone point me to a solution for this.
Thanks,
--
Dominik
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users