Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6935353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:05:29+00:00 2026-05-27T12:05:29+00:00

Using C# and .Net 4.0 I have a generated schema that looks like this:

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:05:30+00:00Added an answer on May 27, 2026 at 12:05 pm

    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…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.NET MVC RC2. I have a set of classes that were auto-generated
I am using asp.net mvc. I have generated a view that retrieve all unapproved
I'm using .NET 3.5. We have some complex third-party classes which are automatically generated
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
I have defined schema for xml in file packetTemplate.xsd.Using ms tool xsd.exe i have
I'm trying to consume some .NET web services using JAX-WS. I have generated the
I have a .NET web-service client that has been autogenerated from a wsdl-file using
I have an ASP.NET MVC 3 app that is using SQL Server CE 4.0
The problem that I have is this: I have a lot of XSD files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.