W3C home > Mailing lists > Public > www-forms@w3.org > August 2005

Evaluation context for xf:setvalue

From: Sergey Shebanin <splash@rulogic.ru>
Date: Wed, 31 Aug 2005 12:07:13 +0400
Message-ID: <43156531.4010700@rulogic.ru>
To: www-forms@w3.org

Hi there,

I think it is strange thing in recommendation errata for xf:setvalue 
element:

 >The evaluation context for this XPath expression is the result from 
the Single Node Binding.

It needs to use of absolute path in @value. I think it is wrong.

I think that context for xf:setvalue/@value must be same as context for 
xf:output/@value.

Following XForms code illustrates this discomfort:

<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">
  <head>
    <xf:model>
      <xf:instance id="edit">
      	<root xmlns="" id="null">
	    <object id="1"/>
	    <object id="2"/>
	</root>
      </xf:instance>

    </xf:model>
  </head>
  <body>

	<xf:repeat nodeset="instance('edit')/object" id="list">
	    <xf:trigger appearance="minimal">
        	<xf:label>Go</xf:label>
	  	<xf:action ev:event="DOMActivate">
		    <!-- context of xf:output is current repeat row -->
		    <xf:message level="modal"><xf:output value="@id"/></xf:message>
		    <!-- this is properly use of xf:setvalue by the errata -->

		    <xf:setvalue ref="instance('edit')/@id" value="instance('edit')/object[index('list')]/@id"/>
		    <!-- this is my view of correct use of xf:setvalue -->
		    <xf:setvalue ref="instance('edit')/@id" value="@id"/>
		</xf:action>
	    </xf:trigger>
	</xf:repeat>
  </body>
</html>
Received on Wednesday, 31 August 2005 08:08:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:01 GMT