This is one form of the general problem discussed on the status page (http://jibx.sourceforge.net/status.html#problems). The only workaround I can suggest is adding a test-method to the containing object class to see if the "c" value is present, then specify that test method on the outermost structure as: <structure name="a" usage="optional" test-method="hasC"> (where "hasC" is the test method that basically just returns getC() != null).

I'll finally get this fixed in beta 4, but until then the workaround will be needed.

- Dennis

Gia Ne wrote:

Hi,

I have an issue while marshalling a nested optional element:

The binding structure is as following:

<structure name="a" usage="optional">

<structure name="b" usage="optional">

<value name="c"

get-method="getC"

set-method="setC"

style="element"

usage="optional"/>

</structure>

</structure

Xml with non-null C property:

<root>

<a>

<b>

<c>somevalue</c>

</b>

</a>

<something> iiiii </something>

</root>

Xml with null c property:

<root>

<something> iiiii </something>

</root>

If c element is null, the expectation is neither tags <a>, <b> nor <c> shouldn’t showed up.

However, this is being return after marshalling:

<root>

<a><b/></a>

<something> iiiii </something>

</root>

Please advice. Thanks




------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to