XML Validation: Invalid simple type value dateTime

  • I have an issue with validating an XML file I have from a 3rd party.

    Willing to improve and standardise company's process, I have created an XML schema collection (SQL 2008R2), but when I validate the XML

    file against it I always keep getting the above error: Invalid simple type value dateTime.

    Definition of dateTime from w3schools website says:

    ------ Start of quote ----

    "DateTime Data Type

    The dateTime data type is used to specify a date and a time.

    The dateTime is specified in the following form "YYYY-MM-DDThh:mm:ss" where:

    YYYY indicates the year

    MM indicates the month

    DD indicates the day

    T indicates the start of the required time section

    hh indicates the hour

    mm indicates the minute

    ss indicates the second

    Note: All components are required!

    The following is an example of a dateTime declaration in a schema:

    <xs:element name="startdate" type="xs:dateTime"/>

    An element in your document might look like this:

    <startdate>2002-05-30T09:00:00</startdate>

    ------ End of quote ----

    So I would assume that dates like 2012-10-24T14:23:00 or 2012-10-24T14:15:00 should be fine, but no -fails.

    It works though only if I add "Z" at the end. Obviously 3rd party do not want to change anything, as it works for ages.

    Anything you cand advise, please?

    THANKS!

  • http://connect.microsoft.com/SQLServer/feedback/details/167649/xml-schema-collection-does-not-properly-validate-an-xsd-datetime

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Thanks, but found the issue already - that problematic DB of mine had a compatibility set back to 80 (2005). Once changed, all is working.

    Thanks again.

  • BOR15K (6/24/2014)


    Thanks, but found the issue already - that problematic DB of mine had a compatibility set back to 80 (2005). Once changed, all is working.

    Thanks again.

    Actually, compatibility level 80 is SQL Server 2000.

  • Agree - my bad. It should be read "that problematic DB of mine had a compatibility set back to 90 (2005)"

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply