I have a validation module in Python that executes an XQuery on an XML document to check if any <Start>
times come after <End>
times, and return the count of them. The query is as follows:
for $d at $count in ./ty:Detections/Detection
where $d/Start > $d/End
return $count
Now this works fine and good for all cases except when milliseconds are appended to an End time but not a Start time, e.g.:
<Start>2009-02-23T02:53:14Z</Start>
<End>2009-02-23T02:53:14.226Z</End>
This always returns True, even though clearly 14 is less than 14.22.
If I add a single decimal place to the <Start>
time here, it works -- but is there any better solution?