W3C home > Mailing lists > Public > public-xformsusers@w3.org > March 2014

Re: Access to arguments

From: Erik Bruchez <erik@bruchez.org>
Date: Wed, 19 Mar 2014 09:35:54 -0700
Message-ID: <CAAc0PEUTQ19r6mxzCv_Ur0mF6X+XNMKgHeZz8qUC_R5SD3uxgQ@mail.gmail.com>
To: Steven Pemberton <Steven.Pemberton@cwi.nl>
Cc: Forms WG <public-forms@w3.org>, "public-xformsusers@w3.org" <public-xformsusers@w3.org>
We have extensions functions for that:

    http://wiki.orbeon.com/forms/doc/developer-guide/xforms-xpath-functions#TOC-HTTP-request-functions

For your use case we have:

    xxf:get-request-parameter()

That sounds a bit server-side as an API name though.

BTW browsers have Window.location and Document.location which return
Location objects, but there doesn't seem to be anything to parse the
query string:

https://developer.mozilla.org/en-US/docs/Web/API/Location

-Erik

On Wed, Mar 19, 2014 at 8:12 AM, Steven Pemberton
<Steven.Pemberton@cwi.nl> wrote:
> I have a need to access the arguments given to a the URL that causes an
> XForm to load.
>
>         http://www.example.com/form.xml?type=1&name=foo
>
> One option would be a pseudo-instance:
>
>         <setvalue ref="bar" value="instance('arguments')/name)" />
>
> but I imagine it would be easier to implement a function:
>
>         <setvalue ref="bar" value="argument('name')" />
>
> Any opinions?
>
> Steven Pemberton
>
Received on Wednesday, 19 March 2014 16:43:35 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:48:26 UTC