You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Radhakrishnan J <ra...@tavant.com> on 2004/07/15 17:12:23 UTC
How to avoid automatic setting of xsi:nil attribute ?
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/