Page 1 of 1

Correct use of xsd:duration

Posted: Wed Feb 01, 2006 10:58 pm
by cberrymd
I have an element named dateEntered. To be valid it must be within the past 2 weeks. This explains what I'm trying to get to in pseudocode.

attribute dateEntered
{
xsd:date
{
minInclusive ="today" - P14D
maxInclusive ="today"
}
} , # a date within the past two weeks

Can somebody help me get to the real code?

Posted: Thu Feb 02, 2006 11:17 am
by george
Hi,

You cannot do that in XML Schema and it is har do no it in any schema language I think, just because today is not clearly defined - is that the time when the instance is created or the time the instance is checked? If it is the later then it is really strange to see a document became invalid just because you perform the validation at a givem moment in time.

Best Regards,
George