W3C home > Mailing lists > Public > www-forms-editor@w3.org > April 2007

<setvalue/> XPath evaluation context improvements

From: Ivan Latysh <IvanLatysh@yahoo.ca>
Date: Wed, 18 Apr 2007 17:42:21 -0400
Message-ID: <1249180113.20070418174221@yahoo.ca>
To: www-forms-editor@w3.org

Hello all,

  I want to propose a change to XForm spec regarding <setvalue/> "value" attribute evaluation context.
  Currently spec force setvalue element to use target node context:
     "The evaluation context for this XPath expression is the result from the Single Node Binding."
  When in fact it should honour current scope and be consistent with other XForms elements.

  I propose to update <setvalue/> "value" definition with:
    Optional XPath expression to evaluate, with the result stored in the selected instance data node.
    The evaluation context for this XPath expression described in 7.4 Evaluation Context.

  Here is the real-world use-case that will work after the change:
    <xf:model id="myModel">
      <xf:instance id="myInstance" xmlns="">
    <xf:repeat nodeset="instance('myInstance')/fruit" model="myModel" id="fruits-repeat">
        <xf:action ev:event="DOMActivate">
          <xf:setvalue ref="instance('myInstance')/bad-fruit" value="."/>

  Taking into the consideration that such change may cause certain issues with existing forms John M. Boyer propose to
  add a flag that will govern XForm behaviour:
  [John M. Boyer]
  I couldn't say what to name it, but maybe another attribute on the default model would do the trick.  Something like
  unifiedcontext= "true|false".  The true setting would say that all attributes of an element are evaluated with the
  in-scope evaluation context (i.e. the result of @context, if it appears, or the default otherwise). The true setting
  could even be the default for 1.1, and the false setting could be the default for 1.0 forms.
  [John M. Boyer]

  Also I belive that we can add the "version" attribute to <html/> tag.
  For example:
  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
   xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xf:version="1.1">

Best regards,
 Ivan                          mailto:IvanLatysh@yahoo.ca
Received on Wednesday, 18 April 2007 21:46:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:38:09 UTC