- From: Erik Bruchez <ebruchez@orbeon.com>
- Date: Mon, 20 Feb 2023 21:23:53 -0800
- To: Alain Couthures <alain.couthures@agencexml.com>
- Cc: "public-xformsusers@w3.org" <public-xformsusers@w3.org>
- Message-ID: <CAAc0PEUW5ZC7BnaSy-XJ9ezE05ubxO-58e_kYT0c8NKjdMfJJg@mail.gmail.com>
All, This is annoying. The `numeric` solution only works for functions that take one or more `numeric` arguments, so you know that if you pass an `xs:integer` in you get an `xs:integer` out, for example. Here neither `index()` nor `seconds()` have a numeric parameter. And I think that it would be a little weird if the `index()` function returned sometimes an `xs:integer` and sometimes an `xs:double`. I'd rather we say that the functions: 1. always return an `xs:double` 2. or returns the empty sequence in case of incorrect input If these functions were new, I'd prefer solution 2, but that is backward-incompatible with XForms 1.1 so solution 1 might be preferable. -Erik On Fri, Feb 17, 2023 at 1:34 AM Alain Couthures < alain.couthures@agencexml.com> wrote: > Hello, > > Many signatures for xf: functions, such as xf:index() > https://www.w3.org/community/xformsusers/wiki/XPath_Expressions_Module#The_index.28.29_Function > and xf:seconds() > https://www.w3.org/community/xformsusers/wiki/XPath_Expressions_Module#The_seconds.28.29_Function, > specify an xs:integer or an xs:decimal return type but these functions can > also return the "NaN" (not-a-number) value which is just defined for > xs:float and xs:double. > > While XPath 3.1 now specifies the xs:numeric union type, for XPath 2.0, > mentioning "numeric" allows implementations to return a value with the most > accurate numeric type as for fn:abs() > https://www.w3.org/TR/xquery-operators/#func-abs. > > What do you think? > > --Alain >
Received on Tuesday, 21 February 2023 05:24:19 UTC