Compare two dates in XSD 1.1?
Posted: Wed Mar 08, 2017 12:14 pm
I want to write a number of assertions to compare pairs of dates in XSD 1.1 but it's not working.
Can someone help me get started?
Here's a couple of examples:
So, for example I would like to ensure that all values are earlier (less than) the , and that is always the same as or earlier (less) than (maybe the last update to the record *was* to renew its registration, but the renewal can't happen *without* an update timestamp.
Here's an example of an assertion in the schema:
Am I just getting the XPATHs wrong or is there something about the date format maybe?
Can someone help me get started?
Here's a couple of examples:
Code: Select all
<Records content-date="2006-05-04T18:13:51.0Z">
<Record issuance-date="2006-05-04T18:13:51.0Z"
last-update-date="2006-05-04T18:13:51.0Z"
last-renewal-date="2006-05-04T18:13:51.0Z" >
</Record>
<Record issuance-date="2006-05-04T18:13:51.0Z"
last-update-date="2006-05-04T18:13:51.0Z" last-renewal-date="2006-05-04T18:13:51.0Z">
<Event event-date="2006-05-04T18:13:51.0Z" event-type="INITIAL_REGISTRATION">
</Event>
</Record>
</Records>
Code: Select all
issuance-date
Code: Select all
content-date
Code: Select all
last-renewal-date
Code: Select all
last-update-date
Here's an example of an assertion in the schema:
Code: Select all
<xs:assert id="plausibility-issuance-date-plausibility"
test="@issuance-date < ./@content-date"/>