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

Re: JSON/mediatypes/src/replace

From: John Boyer <boyerj@ca.ibm.com>
Date: Fri, 2 Dec 2011 09:35:59 -0800
To: "Steven Pemberton" <Steven.Pemberton@cwi.nl>
Cc: public-forms@w3.org
Message-ID: <OF641E2F27.70FBA272-ON8825795A.005FED53-8825795A.0060AEC9@ca.ibm.com>
Hi Steven,

It might be better to go with this alternative of saying that the output 
is XML unless otherwise stated.

One issue that arises with the automatic serialization is what to do if an 
instance is read as XML (or JSON) and then a replacement submission 
replaces *part* of the instance with JSON (or XML).  There's no general 
rule about the submission replacement format affecting the subsequent 
serialization of the instance.

Some specialized version of that rule doesn't seem to help much either, 
i.e. it makes more friendly a thing which was not all that unfriendly 
anyway.  The application author will know whether the service being 
contacted expects to receive json or xml, so it does not appear to be a 
problem that the author would request json serialization in the mediatype.

John M. Boyer, Ph.D.
Distinguished Engineer, IBM Forms and Smarter Web Applications
IBM Canada Software Lab, Victoria
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed: 

From:   "Steven Pemberton" <Steven.Pemberton@cwi.nl>
To:     public-forms@w3.org
Date:   02/12/2011 08:29 AM
Subject:        Re: JSON/mediatypes/src/replace

Of course, the other option is always to serialize as XML unless otherwise 


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" 
>                <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" 
> replace="instance" instance="i"/>
>                <submission id="put" resource="http://example.com/data" 
>                <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 17:39:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:48:48 UTC