VS2008: Running xsd.exe on schema file gives XMLSchema: datetime not declared

I have an XSD that looks something like this:

<xs:schema id="Appointment" targetNamespace="http://tempuri.org/Record.xsd" elementFormDefault="qualified"
attributeFormDefault="qualified" xmlns="http://tempuri.org/Record.xsd" xmlns:mstns="http://tempuri.org/Record.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Record" msdata:IsDataSet="true">
    <xs:complexType>
        <xs:choice maxOccurs="unbounded">
            <xs:element name="Record">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="ID" type="xs:string" minOccurs="0" />
                        <xs:element name="TimeStart" type="xs:datetime" minOccurs="0" />
                        <xs:element name="TimeEnd" type="xs:datetime" minOccurs="0" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:complexType>
</xs:element>

      

When I try to generate classes from it using xsd.exe from VS2008, I get string fields instead of date fields and a warning stating that

Schema validation warning: Type 'http://www.w3.org/2001/XMLSchema:datetime' is not declared. Line 13, position 9.

      

Any hints?

+1


source to share


1 answer


Bah, never mind.

Case sensitivity problem.

The correct form to use was



xs:dateTime

      

instead

xs:dateTime

      

+5


source







All Articles