The function Element

ebruchez: i've been back and
forth on this
... We need this for XPath 1.0 and 2.0 but in XPath 3.0 you can
assign functions to a variable but not named functions
... If we would have XPath 3.0+ or XQuery then the function
element wasn't needed

<ebruchez> let foo :=
function0() { …. }

nvdbleek: I think we need it
because you can't define named functions in Xpath 3.0 and we
don't support to add variables in the model, so you can't refer
to the function variables globally

ebruchez: Does Better Forms
support adding functions in the form

nvdbleek: They only support
adding custom function in java

ebruchez: What about XSLTForms
does it supports adding function in javascript

alain: yes

nvdbleek: Are we going to do
anything about it

ebruchez: Functions are needed,
and XSLT did it already, but now wondering about it because
XPath has now native functions
... we can go one way or the other. The feature is not looking
forward...

nvdbleek: In Xpath 3.0 you don't
have custom named functions

ebruchez: It is a bit strange
that they aren't in XPath but are in XQuery
... You want XQuery and XQuery update facility in XForms
... It would be ideal that XForms could say that XForms 2.0
supports XQuery 3.0

nvdbleek: I think that XQuery 3.0
support is currently only feasible for server side
implementations

ebruchez: If we support the
function element, we want to support variables? because Xpath
3.0 is introducing variables

nvdbleek: I think we should
support variables in functions because we only explicitly
support XPath 1.0 and 2.0 and you want to use variables to
simplify XPath expressions

ebruchez: If prefer a simplified
syntax so you don't need elements as children (without variable
support)

nvdbleek: So you don't need
variables
... do you want to drop variable support, or do you want to
different syntaxes

<ebruchez> <function>$i
+ $j</function>

nvdbleek: What if we support
<function>$n <var name="foo" value=".."/>
$foo<function>
... typically you won't simply return $foo but do a calculation
on it

nvdbleek: if we are only allowing
to define functions using XPath do we need the script
element

ebruchez: I don't think we
need

nvdbleek: As it is written I
think you can also use it as an action, and that is already
implemented by a lot of implementations

<ebruchez> <action
type="xpath">

ebruchez: We can put javascript
and xpath expressions in the script element
... We realised that we can use the action element, because it
is just switching the language from xforms, to xpath or
javascript