Login  Register

Re: [ops-users] XForms W3C suite and XPath Functions in Orbeon

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?

>
> -Erik
>
> On Tue, Jan 12, 2010 at 1:20 PM, nvdbleek <[hidden email]> wrote:
>>
>> Hi Erik,  Alessandro, and others,
>>
>> As you probably already know, I'm working on a test harness for the XForms
>> 1.1 test suite. I reworked almost everything compared to what I had at the
>> last XForms WG FtF meeting. The tests now run directly from within the
>> browser. But the main difference is that they are now written in a simple
>> XML format. Currently I've written the tests for Chapter 2 and 7. You can
>> find the source at http://github.com/nvdbleek/com.orbeon.testsuite.w3c if
>> you want to check it out. Please read the Readme.txt to get you up to
>> speed
>> (in fact you have to execute only one ant target). Any comments are
>> welcome.
>>
>> I added some missing XPath funtions to Orbeon see
>> http://github.com/nvdbleek/orbeon-forms
>>
>> I also made changes to seconds-from-dateTime() and seconds-to-dateTime()
>> which I want your opinion about before merging them to my master branch of
>> Orbeon (they are currently on
>> http://github.com/nvdbleek/orbeon-forms/commits/xpath_functions_fixes).
>>
>> The changes I made are:
>> 1) seconds-from-dateTime(): changed the return type from integer to double
>> (to pass test in testsuite)
>>
>> http://github.com/nvdbleek/orbeon-forms/commit/1af695f7ee7b933611bc7ed0aff6cf20e64542a5
>>
>> 2) seconds-to-dateTime(): changed argument type to NUMBER_TYPE ->
>> seconds-to-dateTime((number('NaN')) now returns empty string as specified
>> in
>> the XForms spec
>>
>> http://github.com/nvdbleek/orbeon-forms/commit/9e35d27bc174bfb59993902b326b10d2dfbeee80
>>
>> Could you please give your opinion about these two fixes? I will then
>> incorporate your remarks and merge them afterwards to my master.
>>
>> Thanks in Advance,
>>
>> Nick Van den Bleeken
>> R&D Manager
>>
>> Phone: +32 3 821 01 70
>> Office Fax: +32 3 821 01 71
>> [hidden email]
>> http://www.inventivedesigners.com
>>
>> --
>> View this message in context:
>> http://n4.nabble.com/XForms-W3C-suite-and-XPath-Functions-in-Orbeon-tp1012497p1012497.html
>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>
> ________________________________
> View message @
> http://n4.nabble.com/XForms-W3C-suite-and-XPath-Functions-in-Orbeon-tp1012497p1015129.html
> To unsubscribe from XForms W3C suite and XPath Functions in Orbeon, click
> here.
>



--
Regards,

Nick Van den Bleeken