Posted by
nvdbleek on
Jan 17, 2010; 1:38pm
URL: https://discuss.orbeon.com/XForms-W3C-suite-and-XPath-Functions-in-Orbeon-tp1012497p1016024.html
Hi Erik,
> Changes to seconds-to-dateTime():
>
> The change to the parameter seems fairly safe.
>
> On the other hand, our implementation of the function returns an
> xs:dateTime, so I don't think it is reasonable that the function can
> also return an empty string if the parameter is NaN. I would rather
> return an empty sequence. Basically what I don't like is that the
> function can return different types depending on the parameter.
> Hopefully changing to an empty sequence doesn't cause a problem with
> the test suite? The alternative is to always return a string as per
> XForms 1.1, but this is less in line with XPath 2.0.
>
> Changes to seconds-from-dateTime():
You're correct that makes much more sense in XPath 2.0 and doesn't
breaks the test case. I've changed it to an empty sequence, and merged
it to my master branch
(
http://github.com/nvdbleek/orbeon-forms/commit/7afab1ac32c5aa1b98a2b73366cc4cab6114807e).
>
> I guess those changes are right as per the spec. But a double return
> value doesn't make much sense with XPath 2.0! So I am torn on this
> one.
>
> WDYT?
I always thought seconds-from-dateTime returned an integer when the
input was valid, but the test suite has a case that tests with
'1970-01-01T00:00:00.001Z, and expects 0.001. I'm not sure why you
would ever need the fractional part in a form, and you can run into
rounding errors... Maybe we should bring this to the WG groups
attention (I was to focussed on making the test suite tests working).
Do you think it is worth sending an e-mail to the WG list?
--
Regards,
Nick Van den Bleeken