As I started to implement a validation for XML against a XSD with the standard component XMLType, I encountered following issue regarding datetimes.
Using XMLType and its own function schemaValidate, I validated a sample XML against an already registered XSD. I always got an error despite the fact that any Online-Validator (like http://www.utilities-online.info/xsdvalidation/) told me that the XML is valid.
ORA-30992: error occurred at Xpath /Document/date ORA-01830: date format picture ends before converting entire input string ORA-06512: at "SYS.XMLTYPE", line 369 ORA-06512: at line 174 30992. 00000 - "error occurred at Xpath %s" *Cause: *Action: See the following error and take appropriate action.
After a deep look into the XSD I noticed a datetime-field.
<xs:element name="date" type="xs:datetime"/>
The lexical representation, recommended by the W3C looks like
'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?
It seems like Oracle supports only
'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss
which means, that only datetimes like 2014-07-06T13:41:12 are supported. Any other formats, espeacially those with time-offsets would result in an invalid XML.