[xsde-users] xs:date , xs:datetime validation

Yegnaram, Shrikant SYegnaram at cls-bank.com
Wed Mar 15 00:54:56 EDT 2023


Hi Team,

We are using xsde-3.2.0-x86_64-linux-gnu release .

Following is the XSD we are using for our test:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns="http://www.cls.com/datetimetest" targetNamespace="http://www.cls.com/datetimetest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="dateTimeTest">
<xs:complexType>
<xs:sequence>
<xs:element name="datetime" type="xs:dateTime"/>
<xs:element name="date" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Following options were used to generate the runtime files from the XSD
xsde cxx-hybrid --generate-inline
--generate-parser
--generate-clone
--generate-aggregate
--generate-serializer
datetimetest.xsd

 As part of our test, we used following XML.
This XML does not fail the XSD validation, even though the <date> tag value is invalid.

<?xml version="1.0" encoding="utf-8"?>
<ns2:dateTimeTest xmlns:ns2="http://www.cls.com/datetimetest">
  <datetime>2012-01-31T04:12:12</datetime>
  <date>2023-02-30</date>
</ns2:dateTimeTest>

 Same issue i.e parsing success was found for dates like below
2023-04-31
2023-02-29

Same issue is observed for xs:datetime fields as well.

As per W3 website, W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes<https://www.w3.org/TR/xmlschema11-2/#date>
Constraint: Day-of-month Values
The *day* value must be no more than 30 if *month* is one of 4, 6, 9, or 11, no more than 28 if *month* is 2 and *year* is not divisible by 4, or is divisible by 100 but not by 400, and no more than 29 if *month* is 2 and *year* is divisible by 400, or by 4 but not by 100.

Given this constraint, expectation from the Codesynthesis XSD/e product is expected to validate the number of days in a date value.
Please check the same and revert the findings to us.


 Thanks,

Shrikant Yegnaram

CLS Classification: Confidential Information

This email was classified by Yegnaram, Shrikant on Wednesday, March 15, 2023 12:53:26 AM

CLS is committed to protecting and safeguarding your personal data. Our privacy notice<https://www.cls-group.com/privacy> provides you with information about how we process and protect your personal data. We aim to ensure direct marketing is reasonable, proportionate and of relevance to you. However, if you no longer want to receive direct marketing from us please email dpo at cls-services.com<mailto:dpo at cls-services.com>.

************************************************************************************************************************************************************************
WARNING: This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender 
therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of this e-mail transmission. If verification is required, please request a hard copy version.

CLS is committed to protecting and safeguarding your personal data. Our privacy notice (https://www.cls-group.com/privacy) provides you with information about how we process and protect your personal data.
We aim to ensure direct marketing is reasonable, proportionate and of relevance to you. However, if you no longer want to receive direct marketing from us please email dpo at cls-services.com


More information about the xsde-users mailing list