W3C home > Mailing lists > Public > public-xformsusers@w3.org > August 2018

Re: uri-* Functions

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 29 Aug 2018 14:30:24 +0200
To: public-xformsusers@w3.org, "Andreas Mixich" <mixich.andreas@gmail.com>
Message-ID: <op.zoic0yjfsmjzpq@steven-xps>
One major use-case of the URI-* functions is to allow you to initialise an  
XForms with values when you cann it:

    http://example.com/form?x=1&y=2

with, in the form, using location-uri() to get the URI used, and then  
extracting the parameters from that. These are in the query part, which  
was why my proposal included a parsing of the query parameters:

<query><param name="id">42</param><param name="n1">v11</param></query>

or

<query name="id">42</query>
<query name="n1">v11</query>

to make this use-case easy to handle.

Just yielding the query string would make this harder to do.

Steven


On Tue, 28 Aug 2018 10:17:17 +0200, Andreas Mixich  
<mixich.andreas@gmail.com> wrote:

> Hello,
>
> XPath Expressions Module describes several uri-* functions, besides the  
> one, which is logically bound to an  XForm (xf:location-uri()). Are  
> these many functions really needed >or would a map, containing all IRI  
> components (including those from the rfc8141 URN update), suffice? I am  
> aware, though, that maps are not available in XPath2. So, please take  
> the following lines just >as gentle inspiration to any future  
> developments.
>
> A map like this could be:
>
>> let $map :=
> {
>  'scheme'      : xs:string,
>  'authority'   : xs:string,
>  'path'        : xs:string,
>  'query'       : xs:string,
>  'fragment'    : xs:string,
>  'user'        : xs:string,
>  'password'    : xs:string,
>  'host'        : xs:string,
>  'port'        : xs:string,
>  'filename'    : xs:string,
>  'nid'         : xs:string,
>  'nss'         : xs:string,
>  'r-component' : xs:string,
>  'q-component' : xs:string,
>  'f-component' : xs:string,
>  'is-urn'      : xs:boolean
> }
>
> I came around this thought while writing a (generic, not XForms  
> related)  XQuery library module, that tries to offer this kind of IRI  
> parsing, and found out, that there is >some proposal in the XForms2 spec  
> for such functionality. Since such functionality may also satisfy usage  
> scenarios outside of the XForms domain, I wonder, whether it may make  
> >sense about having such functionality become part of any future XPath  
> update. Since that may take time (who is in charge of such activity,  
> right now?), this community could >implement a single function,  
> resulting in a map, similar as shown above. In case of XPath2  
> compatibility, as it seems to be required by the aforementioned  
> document, such a >function may return an XML document, containing the  
> components.
>
> --Minden jót, all the best, Alles Gute,
> Andreas Mixich
Received on Wednesday, 29 August 2018 12:30:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:50 UTC