Dennis,

Thanks for looking into this.  Also, I wanted to thank you for putting together 
such a great framework.  This project was the perfect solution to my problem 
and I was completely blown away by the flexibility and ease of use of this 
framework.  Please keep up the great work!

Thanks,

*************************************
Paul Poole
J2EE Developer
Business Process Automation
Conseco
Carmel, IN 46032
Phone: 317-817-4032
*************************************


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Dennis
Sosnoski
Sent: Monday, February 14, 2005 4:09 PM
To: [email protected]
Subject: Re: [jibx-users] Marshalling null objects


I'll hold off a few days on the beta 3d release and see if the null 
String issue is an easy fix (along with some of the other open issues) - 
you should be able to do the usage="optional" and default="" combination 
to get a start tag followed by an immediate end tag.

The other issue, generating empty tags, is something that would require 
a change to the marshalling API. I'm planning changes to this anyway, 
though, in order to simplify the generated code (mainly by eliminating 
the return value for all the marshalling methods, but I'm also 
considering adding special methods for the common case of no-namespace 
elements and attributes). I also find the use of a start tag followed 
immediately by an end tag annoying - this shows up with the binding 
generation tools, where a <structure> will always come out as the pair 
of tags, even when there are no child elements. Even though XML 
considers the two cases to be identical it just doesn't look nice.

  - Dennis

Thomas Jones-Low wrote:

> Poole, Paul wrote:
>
>> I apologize if this is discussed elsewhere; I tried finding a 
>> solution to my problem, but to no avail.
>>
>> When marshalling to produce xml from my objects, if a String is null, 
>> then a NullPointerException is thrown.  I found that if I set 
>> usage="optional", then the exception went away, but an empty tag was 
>> not output to the xml.  I thought that if I then provided a default 
>> value, then that default would be used when a null String was 
>> encountered.
>> My mapping xml looks like this:
>> <value name="IssueAge" field="issueAge" usage="optional" default="" />
>>
>
>     I've ended up with this same problem at one time. We needed to use 
> a custom unmarshaller method to support this. It wasn't difficult, but 
> by default JiBX refuses to output empty elements.
>
>     There is no way to get JiBX to issue a consolidated empty element. 
> This is due to the method which JiBX generates the unmarshalled text.
>
>     I believe I've added the first to the old bug requests, but have 
> not looked to see if it's in the new bug request system.
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to