W3C home > Mailing lists > Public > public-xformsusers@w3.org > February 2016

Re: xforms-link-exception and scripts

From: Philip Fennell <Philip.Fennell@marklogic.com>
Date: Wed, 17 Feb 2016 08:37:11 +0000
To: Erik Bruchez <erik@bruchez.org>, "public-xformsusers@w3.org" <public-xformsusers@w3.org>
Message-ID: <CE631F04-8862-4882-8989-37C2CB6732B9@marklogic.com>
Erik,

> Now I am not entirely sure that action/@src (previously
> xf:script/@src) is really needed in the first place. It's a unclear
> when the content of the script is loaded: is it every time the action
> runs?

I would hope that it only loads once but I agree with you that there are other mechanisms for loading external scripts and I think there is a case for removing action/@src.


Regards

Philip





On 17/02/2016 06:12, "ebruchez@gmail.com on behalf of Erik Bruchez" <ebruchez@gmail.com on behalf of erik@bruchez.org> wrote:

>All,
>
>We still have an `xforms-link-exception` event which is fatal. It is
>used in the following places:
>
>1. instance/@src and instance/@resource
>2. loading of external schemas
>3. the new action/@src [1]
>
>I find that #3 particularly is annoying: if the script is meant to be
>loaded during action processing, an xforms-action-error should occur
>instead, or some other event which does not cause the entire
>processing to stop.
>
>Now I am not entirely sure that action/@src (previously
>xf:script/@src) is really needed in the first place. It's a unclear
>when the content of the script is loaded: is it every time the action
>runs? That would be wasteful, as presumably @src would be used for
>larger scripts. In browsers, external script content runs just once.
>So if script content runs only once, would it be the first time the
>action runs, or upon XForms initialization, or something else?
>
>If script content is large, you can load it, in HTML, with a regular
><script> element. If that script exposes functions, a small inline
>script can call them.
>
>Inline scripts are easier because we can model each inline script
>content as a function: load it once, and run it every time the action
>runs, passing parameters as needed.
>
>So if it turns out we don't need action/@src because we can't define a
>clear processing model for it, the question of xforms-link-exception
>for this action would go away.
>
>Thoughts?
>
>-Erik
>
>[1] https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_action_Element

>
Received on Wednesday, 17 February 2016 08:37:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 17 February 2016 08:37:44 UTC