Specifying a Separator for Submission

Mark Birbeck's picture

Now that we have set up a data island ready to send to Flickr, we can go on to prepare the request that will be used to indicate where to send everything. You saw earlier how to specify a request to del.icio.us, and we need to do much the same here:

      </xf:instance>
      <xf:submission id="sub-flickr"
       method="get" action="http://www.flickr.com/services/rest/"
       separator="&amp;"
      />
    </xf:model>

The only difference you will see is that we had to explicitly say that the separator value is "&amp;", since with XForms the default is ";". (We didn't bother to do this for del.icio.us, since their servers understand both values.)

Save the form, refresh, type a value into the input control, and press the "Find" button, and you should get something like this:

Screenshot of XML returned from Flickr.

We mentioned in an earlier section that replacing the form with the data returned from the server was the default behaviour for XForms, making it exactly the same as HTML forms. In the next section we'll show how to make use of the XML without replacing the entire form, but before we do, go 'back' in the browser to your form, and try pressing "Find" again without entering a tag; note that this time you should get an error message from Flickr:

Screenshot of XML returned from Flickr when there is an error.