Login  Register

Re: Re: Re: Re: Xpath fn:seconds-from-dateTime() not working

Posted by Erik Bruchez on Feb 22, 2011; 4:15am
URL: https://discuss.orbeon.com/Xpath-fn-seconds-from-dateTime-not-working-tp3313272p3318531.html

SD,

As noted, seconds-from-dateTime() is defined both in XForms and in XPath 2.0. For some reason we have never noticed this conflict.

In XForms 1.0 and 1.1, its signature takes a string, and its meaning is different from XPath 2.0's: it returns the number of seconds since 1970-01-01T00:00:00Z.

The XForms 1.1 function is the one kicking in in Orbeon Forms, and this is why you are seeing a large number.

I am not sure we have a workaround for this at this time. As I don't like so much the time/date functions from XForms, I am tempted to say that the XPath 2.0 function should be the one kicking in instead, and that xforms: seconds-from-dateTime() would give access to the XForms version.

Thoughts?

-Erik

On Fri, Feb 18, 2011 at 12:24 PM, ssethia <[hidden email]> wrote:

Florain,

Thanks, it works but the return value is a huge integer (1289509005) also
all the remaining functions {eg: minutes-from-dateTime(xs:dateTime(time))}
works smoothly except this one. Why is it so that the seconds-from-dateTime
needs a string while the minutes-from-dateTime doesn't.

regards
--SD
--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Xpath-fn-seconds-from-dateTime-not-working-tp3313272p3313481.html
Sent from the Orbeon Forms (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


On Fri, Feb 18, 2011 at 2:14 PM, Snehadeep Sethia <[hidden email]> wrote:
Thanks a lot.

On Fri, Feb 18, 2011 at 2:31 PM, Florian Schmitt <[hidden email]> wrote:
ssethia,

> Thanks, it works but the return value is a huge integer (1289509005)

correct - that's what the xforms 1.1 seconds-from-dateTime should
return. It doesn't extract the seconds part of the dateTime value but
computes the seconds since 1970-01-01T00:00:00Z (1).

> also all the remaining functions {eg:
minutes-from-dateTime(xs:dateTime(time))}
> works smoothly except this one. Why is it so that the seconds-from-dateTime
> needs a string while the minutes-from-dateTime doesn't.

hmm - i'm not sure... regarding minutes-from-dateTime, there's no
XForms 1.1 function with the same name, so it seems that the XForms
functions take precedence if there's a name conflict, but the XPath
functions are still available. So, the next question would be how to
persuade the XForms processor to handle seconds-from-dateTime as XPath
function...

(1)
http://www.w3.org/TR/2009/REC-xforms-20091020/#fn-seconds-from-dateTime

florian


--
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




--
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