my understanding of castor processing is that there is a semantic difference between an 'empty' element (<xxx/> or <xxx></xxx>) and a 'non-existent' element. So one solution would be to eliminate these empty elements from the xml. The other solution would be writing your own field handler for these fields and mapping the 'empty' value to whatever you want for a 'java' representation (there are examples of field handlers online)
It sounds like you would like some configuration option where 'empty' elements were treated as 'non-existent' - but that is for the castor developers to decide if its worth the effort. -----Original Message----- From: Pandey, Dinesh [mailto:[EMAIL PROTECTED] Sent: Fri 7/29/2005 4:45 PM To: Pandey, Dinesh; [email protected] Subject: [castor-user] RE: Avoiding setting empty integer elements to zero I am still looking (desperately) for a solution for this issue. If anyone has any idea how we can get around this issue, please let me know. Thanks, Dinesh _____ From: Pandey, Dinesh Sent: Tuesday, July 26, 2005 10:56 AM To: '[email protected]' Subject: Avoiding setting empty integer elements to zero Hi, I am using Castor for unmarshalling my xml file and am facing an issue right now. I have few fields in my xml that are integer type and my Castor generated objects have type Integer for them. When I unmarshal, I get all the empty elements in the xml as Integer objects with 0 value, while I would like null Integer objects. Same is the case with empty String elements, I want them to be null instead of empty String (""). Can someone please help me with this? Thanks, Dinesh ----------------------------------------- CONFIDENTIALITY NOTICE: This electronic message transmission is intended only for the person or the entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. If you have received this transmission, but are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this information is strictly prohibited. If you have received this e-mail in error, please contact SHPS at [EMAIL PROTECTED] and destroy the original message and all copies. ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

