W3C home > Mailing lists > Public > public-forms@w3.org > December 2011

Re: JSON/mediatypes/src/replace

From: Steven Pemberton <Steven.Pemberton@cwi.nl>
Date: Fri, 02 Dec 2011 17:28:11 +0100
To: public-forms@w3.org
Message-ID: <op.v5veo3o2smjzpq@steven-750g>
Of course, the other option is always to serialize as XML unless otherwise  
told.

Steven

On Fri, 02 Dec 2011 16:08:36 +0100, Steven Pemberton  
<Steven.Pemberton@cwi.nl> wrote:

> Take this XForm (fragment), which loads an instance, changes a value,  
> and writes it out again:
>
> <model>
> 	<instance src="http://example.com/data"/>
> 	<submission id="put" resource="http://example.com/data" method="put"/>
> 	<action ev:event="xforms-ready">
> 		<setvalue ref="date" value="now()"/>
> 		<send submission="put"/>
> 	</action>
> </model>
>
> I believe we agreed (just checking) that this will work whether the data  
> coming in is XML or JSON. In other words, the submission uses the same  
> mediatype to serialise as the instance was populated with.
>
> I think the same should be true in this case, where instead of using  
> src=, the instance is populated with a submission replace="instance."  
> Again, just checking.
>
> <model>
> 	<instance id="i"/>
> 	<submission id="get" resource="http://example.com/data" method="get"  
> replace="instance" instance="i"/>
> 	<submission id="put" resource="http://example.com/data" method="put"/>
> 	<action ev:event="xforms-ready">
> 		<send submission="get"/>
> 		<setvalue ref="date" value="now()"/>
> 		<send submission="put"/>
> 	</action>
> </model>
>
> Steven
Received on Friday, 2 December 2011 16:28:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:56 UTC