Re: replace="instance" and the instance doesn't exist

On Mon, 13 Apr 2020 20:18:31 +0200, Erik Bruchez <ebruchez@orbeon.com>  
wrote:

> I am not sure the spec says.
>
> If this happens, our implementation dispatches an `xforms-submit-error`  
> event with a `target-error`, which was specified in >XForms 1.1 but  
> seems to have disappeared from 2.0.

What seems to have happened is that we split the target-error case into a  
number of subcases:

https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Replacing_Data_with_the_Submission_Response

>
> The following should produce the same error if possible:
>
> - instance="missing-instance"

"Resolving ID References"  
[https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Resolving_ID_References]  
says:

    "an xforms-binding-error occurs if there is a null search result for  
the target object indicated by attributes bind, model and instance."

> - targetref="instance('missing-instance')"

The instance function  
[https://www.w3.org/community/xformsusers/wiki/XPath_Expressions_Module#The_instance.28.29_Function]  
says

    "In all other cases, an empty sequence is returned,"

and Replacing Data with the Submission Response  
[https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Replacing_Data_with_the_Submission_Response]  
says:

    "if the replacement target node is the empty sequence, submission fails  
with target-empty;"

So I think we are covered, and I don't believe I have to make any changes.

Correct me if you think otherwise.

Steven


>
> -Erik
>
> On Mon, Apr 13, 2020 at 7:43 AM Steven Pemberton  
> <steven.pemberton@cwi.nl> wrote:
>>
>> https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Replacing_Data_with_the_Submission_Response
>>
>> What should happen if I have a submission
>>
>>    <submission ... replace="instance" instance="foobar"/>
>>
>> and foobar doesn't exist (or if it isn't an instance)?
>>
>> Steven

Received on Wednesday, 15 April 2020 13:54:50 UTC