Re: Context consuming actions

Hi John,

I believe this problem is related to the one I send to the list a  
while back [1]. In my implementation since the UI's bindings is first  
rewire in the refresh event and your event sequence is running in a  
deferred action scope then the trigger will first have a null context  
after the action block. If you had a xforms:refresh between the  
delete and setvalue then the setvalue would get a null context.

So in my implementation I only update the context for the UI in the  
refresh handling. I execute the XPath expression on actions for every  
execution (I'm unsure if the specification is clear about this). My  
XPath implementation can handle that the trigger's context node is no  
longer in the document and e.g. <setvalue ref=".."/>  evaluate to a  
null node in your example.

I wouldn't use an exception for this scenario at all. I thought that  
a null context for an action would result in a NOP. That is want I do  
since I thought binding-exception was used only when something was  
bad with a IDREF pointing no way or to something wrong. Also the  
point that an exception terminates processing seems a bit to much for  
me since it could be intentional by the author. E.g.
<xforms:setvalue ref="self::node()[conditional expression]"  
value="[value expression]"/>
if the conditional expression make the ref evaluate to the empty node- 
set would the value expression then also dispatch a binding  
exception? I guess it shouldn't and that this scenario is not really  
different from yours.

Best regards,
David

[1] Question about updating UIInline inside of message
http://lists.w3.org/Archives/Public/www-forms-editor/2006Jan/0009.html

Den Mar 31, 2006 kl. 9:38 PM skrev John Boyer:

>
> We have been assuming up to now that if an action consumes the context
> node, then any subsequent action requiring an XPath evaluation should
> fail with an exception.
> We've been using binding exception as the most reasonable exception,
> but because this exact case is not called out in the spec, it seems  
> reasonable
> to ask the community about it...
>
> How are other XForms implementers handling this case?
>
> To be specific, suppose you have an action sequence that
> performs a delete action followed by a setvalue.  However,
> let the delete destroy a node that either is or is an ancestor of
> the context node for the action sequence.
>
> What happens when the setvalue runs?
>
> <trigger ref="/some/node">
>    <label>Don't press me</label>
>    <action ev:event="DOMActivate">
>          <delete nodeset="." at="1"/>
>          <setvalue ref="." value=" 'oops' "/>
>    </action>
> </trigger>
>
> Thanks,
> John M. Boyer, Ph.D.
> Senior Product Architect/Research Scientist
> Co-Chair, W3C XForms Working Group
> Workplace, Portal and Collaboration Software
> IBM Victoria Software Lab
> E-Mail: boyerj@ca.ibm.com  http://www.ibm.com/software/
>
> Blog: http://www.ibm.com/developerworks/blogs/boyer/index.jsp
>

Received on Saturday, 1 April 2006 07:32:28 UTC