Dealing with HTTP response entities when response code is not 200 series

REST calls for correct use of HTTP response codes and entities, and 
supports Content-Type and 400-series responses.
It's currently hard to process 400-series response entities.

For example, consider a web resource which either responds with 200 and 
application/xml, or 40x and application/xml containing a document whose 
top-level element is <error>...</error>.  In the error case, the 
instance data is not replaced, but the event() function does offer 
parsed access to the XML data.

Here are some ideas about how to move forward:

We could provide an event to dispatch from xforms-submit-error which 
continues with what xforms-submit-done processing would have done if the 
response-code had been 200.

<xf:dispatch ev:event="xforms-submit-error" 
if="event('error-type')='resource-error' and 
IS-IT-A-NODESET(event('response-body'))" />

Or, perhaps an attribute on submission for controlling whether 
resource-error causes xforms-submit-error signalling.

<xf:submission resource-error="false()" ... />

Others?

Leigh.

Received on Tuesday, 7 September 2010 17:49:31 UTC