xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Radhakrishnan J <radhakrishna...@tavant.com>
Subject How to avoid automatic setting of xsi:nil attribute ?
Date Thu, 15 Jul 2004 15:12:23 GMT
Hi,

We have a use case where a database table structure maps to a schema
definition. Some of the fields in the database are NULLable. But the element
definition does not state that the element is nillable ( i.e nillable=true
). The elements are of basic data type xs:string. The cardinality for the
element that maps to this field, is set to minOccurs="0" with default value
for maxOccurs. The problem is that when data is retrieved from the database
and an XmlBean instance is constructed, the XmlBean setter is called with a
null argument. And this translates to a 'nil' element in the Xml document (
i.e <someElement xsi:nil="true" /> ) resulting in an invalid document.
Changing the schema definition to make the element nillable is not an option
as of now.

Has someone come across this situation before ? Any idea how to wriggle out
?

Thanks,
Radhakrishnan


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message