See also: IRC log
<trackbot> Date: 03 November 2009
<John_Boyer> Meeting: Forms Working Group Face to Face Meeting
<John_Boyer> scribe: Nick
<John_Boyer> scribenick: nick
<John_Boyer> http://www.w3.org/MarkUp/Forms/wiki/Custom_XPath_functions?highlight=%28CategoryXForms12%29
Erik: We decided on 2009-10-28
call:
... do not have side-effects (unless they call
implementation-defined XPath functions which do have
side-effects).
... follow a syntax close to a subset of what XSLT 2
supports.
... support a simple syntax, which can later be expanded (e.g.
with something closer from XSLT 2's sequence
constructors).
... can be defined and used with XPath 1.0.
... do not support calling XForms actions.
... do not support creating local instances.
... see
http://www.w3.org/MarkUp/Forms/wiki/Custom_XPath_functions#head-7b66eefe36e455ed1e83c6aea3c24e6125f90278
for syntax
<klotz> A good read from dpawson as usual on xslt2 functions odd corners: http://dpawson.co.uk/xsl/rev2/functions2.html
Erik: Do we want to scope
function definitions?
... We currently have encapsulation by groups and repeats, it
is logical for variables, it makes sense for functions
ebruchez: In xslt a function
starts with an almost empty context it only has access to the
global variables
... we could decide to give it the context of where the
function is defined
nick: We should to be careful that this doesn't influence support of function libraries
John_Boyer: I thought the functions would be pure (not be able to access the current context, nor instances)
ebruchez: Our container controls are blocks
klotz: what about input
<John_Boyer> We're discussing the idea of having xpaths within function bodies are evaluated relative to the inscope eval context of the function declaration... not the context where the function *call* appears.
ebruchez: We could also see this as groups, if we support function definitions inside an input
<Steven> Chair: John
ebruchez: we should ask Micheal Kay why they don't support this in XSLT 2.0
unl: Why don't we use dynamic scoping
klotz: dynamic scoping will result in a lot of difficulties
<John_Boyer> <xf:repeat nodeset="purchaseOrder/row">
<John_Boyer> <xf:function name="my:line-total" as="number">
<John_Boyer> <xf:result select="../quantity * ../unitCost"/>
<John_Boyer> </xf:function>
<John_Boyer> <xf:output value="my:line-total()"/>
<John_Boyer> </xf:repeat>
nick: We have three options:
1) Empty context (no variables, empty sequence)
2) The context of where it is defined (variables defined on the preceding:: , and the current context node, position, ...)
3) The context of where you call the function
nick: I'm opposed to option 3
klotz: I'm also apposed to option 3
<John_Boyer> the above example could also be done without local functions as follows:
<John_Boyer> In the model:
<John_Boyer> <xf:function name="my:line-total" as="number">
<John_Boyer> <xf:param name="quantity" as="number"/>
<John_Boyer> <xf:param name="unitCost" as="number"/>
<John_Boyer> <xf:result select="$quantity * $unitCost"/>
<John_Boyer> </xf:function>
<John_Boyer> Then, out in the UI repeat:
<John_Boyer> <xf:repeat nodeset="purchaseOrder/row">
<John_Boyer> ...
<John_Boyer> <xf:output value="xf:my:line-total(../quantity, ../unitCost)"/>
<John_Boyer> </xf:repeat>
John_Boyer: we need referential transparency
and we can do this by running the expressions
<klotz> http://en.wikipedia.org/wiki/Referential_transparency_%28computer_science%29
<unl> s/skoping/scoping/
ebruchez: You have cases where you need functions that are only used in the UI, and don't need to be available in the Model
klotz: It sounds rather convenient to be able to get the context
John_Boyer: you can always pass it, so it shouldn't be a problem to get the context
ebruchez: I would propose to send an e-mail to Micheal Kay to ask about the closure (context).
<John_Boyer> ACTION: Erik to write Michael Kay and get back to group with answers to 1) any significant problems with sending data context to function, 2) any significant problems with locally declared functions. [recorded in http://www.w3.org/2009/11/03-forms-minutes.html#action01]
<trackbot> Created ACTION-577 - Write Michael Kay and get back to group with answers to 1) any significant problems with sending data context to function, 2) any significant problems with locally declared functions. [on Erik Bruchez - due 2009-11-10].
klotz: does transitivity apply with calling functions
ebruchez: When implementing we
can provide other function libraries when you need to evaluate
the expressions inside the custom function
... so it looks like we can decide what the closure is, and
implement it
<group>
<function name="x:f1">...</
<function name="x:f2">...</function>
<function name="x:f3"><sequence select="x:f2()"</function>
<group
<function name="x:f1"><sequence select="x:f3()"</function>
<function name="x:f2">...</function>
could be implemented
John_Boyer: variables can only access only access preceding siblings or preceding siblings of any parent
<John_Boyer> functions at a scope level will be available to all xpaths at that level, but if we do variables, they would be processed in order, and if a function is invoked before the variable exists, then you would get an error
<Steven> Kai Scheppe (Deutsche Telekom) joins as observer
<Steven> Kai, is this personal interest because you used to work at Mozquito, or is there an implied Deutsche Telekom interest?
<Kai> Currently I am surveying the status of working groups that might be of interest to Deutsche Telekom. We do have quite a few forms and are hampered by the expected problems regarding forms. Currently there is no active interest by Deutsche Telekom.
<Kai> Of course, I also would like to see, out of personal interest, what XForms has developed into :-)
<John_Boyer> the 'as' attribute should allow the five basic types of XPath 1.0, which should be converted to predefined xpath 2.0 types if the xpath engine is a 2.0 engine
<Steven> For the benefit of newer members of the group, Kai is acknowledged in XForms 1.0: http://www.w3.org/TR/2003/REC-xforms-20031014/sliceI.html
ebruchez: we could require support for a subset of the xslt 2.0 as (only item()*, node()*, not element(foo:bar))
<John_Boyer> if 'as' uses xpath 2.0 types, that is just a side effect of writing an xpath 2.0 specific function, whose body will have lots of Xpath 2.0 expressions in it, so it just won't run in an xpath 1.0 engine anyway
ebruchez: we could say that in an XPath 1.0 engine only supports the 5 basic types, the XPath 2.0 version supports the XPath 2.0 'as' attribute and the 5 basic XPath 1.0 types
<John_Boyer> ACTION: Erik to amend custom xpath functions spec to say that an XPath 1.0 engine only supports the 5 basic types, the XPath 2.0 version supports the XPath 2.0 'as' attribute and the 5 basic XPath 1.0 types (converted to predefined xpath 2.0 types) [recorded in http://www.w3.org/2009/11/03-forms-minutes.html#action02]
<trackbot> Created ACTION-578 - Amend custom xpath functions spec to say that an XPath 1.0 engine only supports the 5 basic types, the XPath 2.0 version supports the XPath 2.0 'as' attribute and the 5 basic XPath 1.0 types (converted to predefined xpath 2.0 types) [on Erik Bruchez - due 2009-11-10].
ebruchez: Supporting multiple sequence elements in the body of a function requires some extra work, because in xpath 1.0 when you combine sequences of node()* and number you have to convert the number to a text node
are discussing of doing a more general module that can be used by both XSLT 2.0 and XForms
<John_Boyer> or by others besides just xforms
<John_Boyer> Erik says that for xpath 1.0, use of multiple sequence elements for function nodeset result should produce an error if not all sequences are nodesets
<John_Boyer> ACTION: make ednote out of issue of whether function names can be NCName [recorded in http://www.w3.org/2009/11/03-forms-minutes.html#action03]
<trackbot> Sorry, couldn't find user - make
<John_Boyer> ACTION: Erik ednote out of issue of whether function names can be NCName [recorded in http://www.w3.org/2009/11/03-forms-minutes.html#action04]
<trackbot> Created ACTION-579 - Ednote out of issue of whether function names can be NCName [on Erik Bruchez - due 2009-11-10].
<wiecha> zakim ??P3 is wiecha
<John_Boyer> scribe: Uli
<John_Boyer> scribenick: unl
<John_Boyer> http://www.w3.org/MarkUp/Forms/wiki/CategoryXForms12
John_Boyer: talk about external model or dialog?
klotz: components?
John_Boyer: some kind of external model needed in short term
wiecha: 1.2?
... got a list of 12 patterns
John_Boyer: would be good to hear
what the patterns are
... wiki?
John_Boyer: when we have @src, we
might might have to have @resource too
... for the same reasons we have @resource on xf:instance
<John_Boyer> http://www.w3.org/MarkUp/Forms/wiki/Externally_defined_models_with_src_attribute?highlight=%28CategoryXForms12%29
<John_Boyer> resource allows the save/reload capability for document centric xforms, e.g. ODF
<John_Boyer> http://www.w3.org/MarkUp/Forms/wiki/ModelEnhancementRequirements?highlight=%28CategoryXForms12%29
wiecha: do we tackle all those fancy reqs like specialization?
Steven: no, just the model extenalized as a whole
John_Boyer: how do you do paging?
Steven: not my point, just want to reuse the model
Raman: maybe the thing steven needs is an api
Steven: we don't have a name for instances with their binds
klotz:
binds can cross instances
Steven: but they don't have to
klotz: so we are talking about components
Raman: we could do the whole thing (model, binds, ui) as compnents or just @src
ebruchez: we have an implementation of what you describe (incl. private data model)
Raman: the public might just be a projection of the private data model
unl: would like to talk only about @src, not the component stuff right know
wiecha: me too
<John_Boyer> Erik is doing an xi:include example
<John_Boyer> <xi:include href=".../resources-model.xml" ...
<John_Boyer> includes the model inline in the page
John_Boyer: no nested models?
ebruchez: no, just included in parallel
John_Boyer: may become
problematic
... you get frankenstein forms where you could move data
between models
ebruchez: what's wrong with that?
klotz: nothing, just go on
John_Boyer: fragments?
klotz: only with xpointer
John_Boyer: didn't understand what's the problem with nested models
klotz: event bubbling and so on?
ebruchez: benefit of non-nested model inclusion is simplicity
klotz: we should go off and design compenents
ebruchez demoing orbeon impl of components
http://www2.orbeon.com:8080/orbeon/xforms-controls/
<ebruchez> <fr:tutorial-davinci bind="last-name-bind">
<ebruchez> <xforms:label>Last name: </xforms:label>
<ebruchez> <xforms:hint>Please enter your last name</xforms:hint>
<ebruchez> <xforms:alert/>
<ebruchez> </fr:tutorial-davinci>
<ebruchez> <xbl:xbl xmlns:xhtml="http://www.w3.org/1999/xhtml"
<ebruchez> xmlns:xforms="http://www.w3.org/2002/xforms"
<ebruchez> xmlns:xs="http://www.w3.org/2001/XMLSchema"
<ebruchez> xmlns:ev="http://www.w3.org/2001/xml-events"
<ebruchez> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
<ebruchez> xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
<ebruchez> xmlns:xbl="http://www.w3.org/ns/xbl"
<ebruchez> xmlns:xxbl="http://orbeon.org/oxf/xml/xbl">
<ebruchez> <xbl:binding element="fr|tutorial-davinci">
<ebruchez> <xbl:implementation>
<ebruchez> <!-- Local model -->
<ebruchez> <xforms:model>
<ebruchez> <xforms:instance>
<ebruchez> <value/>
<ebruchez> </xforms:instance>
<ebruchez> </xforms:model>
<ebruchez> </xbl:implementation>
<ebruchez> <xbl:template>
<ebruchez> <!-- Outer group implementing the single-node binding -->
<ebruchez> <xforms:group xbl:attr="model context ref bind" xxbl:scope="outer">
<ebruchez> <!-- Copy LHHA elements if any -->
<ebruchez> <xbl:content includes="xforms|label,xforms|help,xforms|hint,xforms|alert"/>
<ebruchez> <!-- Inner group -->
<ebruchez> <xforms:group xxbl:scope="inner">
<ebruchez> <!-- Variable pointing to external single-node binding -->
<ebruchez> <xxforms:variable name="binding" as="node()?">
<ebruchez> <xxforms:sequence select="." xxbl:scope="outer"/>
<ebruchez> </xxforms:variable>
<ebruchez> <!-- When the external single-node binding comes to life or its value changes, copy it to the
<ebruchez> local value after reversing it -->
<ebruchez> <xforms:group ref="$binding">
<ebruchez> <xforms:setvalue ev:event="xforms-enabled xforms-value-changed"
<ebruchez> ref="instance()" value="codepoints-to-string(reverse(string-to-codepoints($binding)))"/>
<ebruchez> </xforms:group>
<ebruchez> <!-- Input points to the internal value -->
<ebruchez> <xforms:input ref="instance()">
<ebruchez> <!-- When the local value changes, copy it to the external single-node binding after reversing it -->
<ebruchez> <xforms:setvalue ev:event="xforms-value-changed"
<ebruchez> ref="$binding" value="codepoints-to-string(reverse(string-to-codepoints(context())))"/>
<ebruchez> </xforms:input>
<ebruchez> </xforms:group>
<ebruchez> </xforms:group>
<ebruchez> </xbl:template>
<ebruchez> </xbl:binding>
<ebruchez> </xbl:xbl>
This is scribe.perl Revision: 1.135 of Date: 2009/03/02 03:52:20 Check for newer version at http://dev.w3.org/cvsweb/~checkout~/2002/scribe/ Guessing input format: RRSAgent_Text_Format (score 1.00) Succeeded: s/I think the functions should be/I thought the functions would be/ Succeeded: s/skoping/scoping/ FAILED: s/skoping/scoping/ Succeeded: s/gon/go/ Succeeded: s/benefit is simplicity/benefit of non-nested model inclusion is simplicity/ Found Scribe: Nick Found ScribeNick: nick Found Scribe: Uli Found ScribeNick: unl Scribes: Nick, Uli ScribeNicks: nick, unl Present: Charlie(remote) Erik Leigh Uli Raman Steven Nick John Agenda: http://www.w3.org/MarkUp/Forms/wiki/FtF_2009_11_TPAC_Agenda Found Date: 03 Nov 2009 Guessing minutes URL: http://www.w3.org/2009/11/03-forms-minutes.html People with action items: erik make[End of scribe.perl diagnostic output]