| Author |
null values in castor unmarshalling
|
maya fur
Greenhorn
Joined: Sep 08, 2005
Posts: 11
|
|
Hi, I'm using castor to unmarshall xml to java objects. The only problem is that I'm not able to get null values... In the xsd the element is nillable <xs:element name="OC" type="xs ouble" nillable="true"/> and in the castor mapping file I defined the type as object, not a primitive <field name="OC" type="java.lang.Double" required="false" direct="false" transient="false"> <bind-xml name="OC" node="element" reference="false"/> </field> In addition, I validate using the schema to unmarshal.setValidation("true"); If my xml does not have a tag, then this is field is null. But if the tag is empty (<OC></OC> then I get a Double with value 0. Any idea how I can get null if the tag is sent? Thanks
|
 |
 |
|
|
subject: null values in castor unmarshalling
|
|
|