Re: Questions about generating new ids on insert

Has anyone actually implemented this?

I tried it a while ago and didn't have a good experience.  
Consequently I resort to using generate-id(), which although not part  
of XForms is actually available in a good range of XForms processors.

All the best

Mark

On 31 May 2006, at 11:37, Allan Beaufour wrote:

>
> The specification of the instance element includes this sentence:
> "In this process, nodes of type xsd:ID are modified to remain as
> unique values in the instance data."
> [http://www.w3.org/TR/2006/REC-xforms-20060314/slice9.html#action- 
> insert]
>
> To that, I have a few questions.
>
> 1) When exactly is this modification taking place?
>
> It matters since nodes might have types associated through <xf:bind
> type=""/>, so these needs to be processed before the nodes actually
> are of type xsd:ID (I guess this takes place during xforms-rebuild.)
>
> But should it take place before or after xforms-recalculate? Before,
> since the form author might want to do calculations based on the
> (possibly new) value? Or after, since the form author might want to
> calculate a new id himself?
>
> If it takes place as "part of" the RRR process, then it needs to be
> deferred too, which might be tricky -- at least from an implementation
> perspective.
>
> 2) Does it adhere to the readonly MIP, ie. does not change readonly  
> nodes?
>
> The form author might, for some reason, not want the nodes to be
> changed, and could thus set readonly="true()" for those nodes to avoid
> that.
>
> 3) Is it on purpose that it is stated as strict as "remain as unique
> values in the instance data"?
>
> Should it have been more like the generate-id() function from XSLT,
> which includes:
> "There is no guarantee that a generated unique identifier will be
> distinct from any unique IDs specified in the source document."
> [http://www.w3.org/TR/xslt#misc-func]
>
> 4) Does the modification follow the normal XForms rules of how to  
> set values?
>
> F.x. for an element, should it only set the first text node child?
>
> -- 
> ... Allan
>

Received on Wednesday, 31 May 2006 10:57:20 UTC