June 23, 2014 at 11:26 am
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!
June 24, 2014 at 5:03 am
June 24, 2014 at 7:54 am
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.
June 24, 2014 at 10:56 am
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.
June 24, 2014 at 11:09 am
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 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy