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

Re: Access to arguments

From: Nick Van den Bleeken <Nick.Van.den.Bleeken@inventivegroup.com>
Date: Thu, 20 Mar 2014 10:52:36 +0000
To: Erik Bruchez <erik@bruchez.org>
CC: Steven Pemberton <Steven.Pemberton@cwi.nl>, Public Forms <public-forms@w3.org>, "public-xformsusers@w3.org" <public-xformsusers@w3.org>
Message-ID: <D155DDC9-CD74-447E-BC2B-07CDA9548647@inventivegroup.com>
We use that extension function constantly, to pass defaults and/or idís to fetch the instance data using submissions. So we are in favour of standardising this (but it is probably a bit late for XForms 2.0)

Kind regards,

Nick Van den Bleeken
R&D Manager

Phone: +32 3 425 41 02
Office fax: +32 3 821 01 71
nick.van.den.bleeken@inventivegroup.com<mailto:nick.van.den.bleeken@inventivegroup.com>
www.inventivedesigners.com


[cid:image001.png@01CBF2F8.1DA19110][cid:image002.png@01CBF2F8.1DA19110][cid:image003.png@01CBF2F8.1DA19110]

On 19 Mar 2014, at 17:37, Erik Bruchez <erik@bruchez.org<mailto:erik@bruchez.org>> wrote:

Oh and yes I prefer a function to an instance.

-Erik

On Wed, Mar 19, 2014 at 9:35 AM, Erik Bruchez <erik@bruchez.org<mailto:erik@bruchez.org>> wrote:
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






________________________________

Inventive Designers' Email Disclaimer:
http://www.inventivedesigners.com/email-disclaimer



image001.png
(image/png attachment: image001.png)

image002.png
(image/png attachment: image002.png)

image003.png
(image/png attachment: image003.png)

Received on Thursday, 20 March 2014 10:53:08 UTC

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