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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to