xsl-list
[Top] [All Lists]

Re: [xsl] XPath string comparison of two strings representing calendar dates ... any counterexamples?

2017-08-16 11:51:19


Note that I am doing mere string comparison. I am comparing the string 
'20170817' against the string '20170816'.

Will the XPath always work? 



It will always work if the dates are valid dates in the Gregorian calendar 
between years 0 and 9999, always represented by 4 digits, and if your default 
collation isn't something pathological where digits collate out of order.

(Come to think of it, it's not totally pathological for a collation to ignore 
leading zeroes in an all-numeric string, so perhaps you're only safe with dates 
from 1000AD to 9999AD)

Michael Kay
Saxonica

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>