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

Boris Kolpackov boris at codesynthesis.com
Mon Mar 20 08:45:31 EDT 2023


Yegnaram, Shrikant <SYegnaram at cls-bank.com> writes:

> Yes we have enabled parser/serializer validation

Thanks for the confirmation.

I dug a bit deeper into this and it appears that the constraint you
have quoted is from the XML Schema 1.1 specification while XSD/e only
aims to conform to XML Schema 1.0 (even more precisely, it only aims
to conform for validation to a subset of it; see [1][2]). And looking
at the XML Schema 1.0 specification, there is no such constraint (but
there is a general statement to the effect that the date shall be
valid). This is the reason why we don't have tighter validation for
these types.

However, the constraint in the XML Schema 1.1 is quite sensible and
is not too expensive to implement (neither with regards to footprint
nor performance). So I went ahead and implemented it (as well as a
similar constraint for gMonthDay). You can find the patch here:

https://git.codesynthesis.com/cgit/xsde/xsde/commit/?id=387d98b80d9f383c4c7708a42444472cb89dd42b

I think it should apply cleanly to XSD/e 3.2.0 if you would like to
give it a try (you will need to apply it and rebuilt the libxsde
runtime). Alternatively, if you would like, I can apply it to 3.2.0
and make the affected files available.

[1] https://codesynthesis.com/projects/xsde/documentation/cxx/parser/guide/#A
[2] https://codesynthesis.com/projects/xsde/documentation/cxx/serializer/guide/#A



More information about the xsde-users mailing list