45E8ACF4DC4D7148AB9A906B6B216DAD01E064CE@dewdfe1m.wdf.sap.corp"
type="cite">
I want to summarize the current state
of the xsi:nil discussion.
We agreed that Option 1 in Ulfs
proposal is the way we want to go further. We add two methods to the
XMLHelper (not to the XSDHelper as in the original proposal.)
boolean isNil(DataObject dataObject);
void setNil(DataObject dataObject, boolean xsiNil);
That means the SDO-implementation
maintains a flag in every DataObject or for each DataObject about it's
xsi:nil state. The nil-flag is only relevant for DataObjects that are
contained in a property with nullable=true, otherwise it will be
ignored. This flag is the representation of xsi:nil in nillable
complex content properties.
For nillable simple content properties the representation of xsi:nil is easier.
xsi:nil="true" means the property's value is null but
isSet()==true. The null-value is good enough to represent all cases for
simple content.
These rules apply for many-valued
properties as good as for single-valued properties. That means the
value-list of a nillable many-valued property can contain null-values
or DataObjects with the nil-flag. With this proposal we can remove 2.
from spec "7.1 Corner cases" because "Multi-valued nillable Properties
with DataObject Types" are not longer a corner case.
Rendering of XML
Each null-value in a nullable property
will be rendered as element with xsi:nil="true".
DataObjects in a nullable property with
the nil-flag==true will be also rendered as element with xsi:nil="true".
In any other case the xsi:nil attribute
is not rendered.
This has the drawback that null and a
DataObject with the nil-flag but without attributes are rendered in the
same way in XML. We could define that these values are equivalent and
have the same meaning to SDO.
Parsing of XML
Simple content elements with
xsi:nil="true" will be represented as null-values after parsing.
Complex content elements with
xsi:nil="true" and other attributes set are represented as DataObject
with the nil-flag==true and the attribute-properties set.
There was a discussion
in the call how complex content elements with xsi:nil="true" without
other attributes should be represented.
We proposed the representation as
DataObject with the nil-flag==true because our customers preferred it
this way.
Others in the call preferred the
representation as null because less objects are created.
We could define an option to let user
decide but we have to agree to a default-behavior.
Stefan.