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.
--
Thomas Jones-Low Softstart Services Inc.
[EMAIL PROTECTED] JobScheduler for Oracle
Ph: 802-398-1012 http://www.softstart.com
------------------------------------------------------- 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
