[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-users
Subject:    Re: [jibx-users] Empty Element placed in content while optional
From:       Dennis Sosnoski <dms () sosnoski ! com>
Date:       2004-09-22 4:34:05
Message-ID: 415100BD.7020902 () sosnoski ! com
[Download RAW message or body]

For this particular case you should be able to restructure your binding 
definition to avoid the problem by replacing the structure with this:

  <collection name="ProductTypeList" usage="optional" 
item-type="com.aaa.ProductTypeLne" field="productTypeLne"/>

The key here is that the <structure> handling currently won't reach down 
into child binding components to see if something is actually present 
when marshalling. Another way of handling this would be to add a simple 
test-method for the <structure> that just checked if the productTypeLne 
field was non-null.

  - Dennis

Neroslavskaya, Elena wrote:

>Hi,
>I have binding defined with structure inside of element like this:
>
><mapping name="ProductTypeLne" class="com.aaa.ProductTypeLne">
>  <structure field="codeDataType" map-as="com.aaa.CodeDataType" /> 
></mapping>
>
><mapping name="FtGetProductTypeListRes"
>class="com.aaa.FtGetProductTypeListRes">
>  <structure map-as="com.aaa.WMResponse" name="HeaderRes" usage="required"
>/> 
> <structure name="ProductTypeLst" usage="optional">
>  <collection item-type="com.aaa.ProductTypeLne" field="productTypeLne"
>usage="optional" /> 
>  </structure>
> </mapping>
>
>So when I'm trying to test round trip on xml that does not have
>ProductTypeLst element
>it fails, because Jibx marshalling places empty ProductTypeLst in the xml
>and
>documents are not equal. Is it possible to turn off placing the empty
>element ?
>  
>


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic