Administrator
|
You can, although the logic can be a bit tricky:
(
for $this in .[string() castable as xs:date] return
for $that-element in $this/../preceding-sibling::*[1]/*[name() = name($this)] return
for $that in $that-element[string() castable as xs:date] return
$that lt $this,
true()
)[1]
What the above says is:
- take the current field if it is a valid date
- find the field with same name in the previous iteration if it is a valid date
- if the the fields are dates and the order is correct, then constraint is satisfied
- if the the fields are dates and the order is incorrect, then constraint is not satisfied
- if either field is not a date, the constraint is satisfied (other validations should kick in)
-Erik
|