Using C# and .Net 4.0
I have a generated schema that looks like this:
<xsd:element name="EstimatedDate" minOccurs="0" nillable="true" default="1900-01-01T00:00:00">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:dateTime">
<xsd:attribute name="origVal" type="xsd:dateTime" use="optional" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
When I serialize the object with a null value I get:
<EstimatedDate xsi:nil="true" />
But I am getting a deserialization: "There must be no fixed value when an attribute is 'xsi:nil' and has a value of 'true'."
When I look at the XML specification I do not see that nillable and default properties are mutually exclusive, but my other dateTime XML types that are nillable but do not have a default property work correctly.
The error message describes a constraint that is present in the spec: Validation Rule: Element Locally Valid (Element) clause 3.3.2 says that when xsi:nil=true, there must be no fixed value. However, there is no ban on a default value, as far as I can see, so it seems your schema processor is over-eager to find fault.
I think the correct behavior for your schema is: if the element is empty and xsi:nil is absent or false, use the default value; if the element is empty and xsi:nil is true, leave it as is.
(you can try getting Microsoft to fix this, or you can try switching to Saxon...)