OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sdo message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [sdo] xsi:nil discussion


Title: xsi:nil discussion
Hello Stefan,

Section 9.3.2 of the SDO 2.1.1 spec states that elements with xsi:nil="true" correspond to null values for the corresponding property.  For preserving backwards compatibility I prefer this is as the default.  Then for cases where attributes are present (which was a broken case in SDO 2.1.1) then a DataObject with the nil flag = true is reasonable.

Presumably if a DataObject has the nil flag = true, then setting a property corresponding to an XMLElement will cause the nil flag to become false?

What about ChangeSummary?  What happens if I create a nil DataObject?   Presumably I don't want the ChangeSummary to flag that as an object that should be inserted into the DataSource

-Blaise

Buennig, Stefan wrote:
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.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]