Re: 7.2 XForms DOM interfaces are specified strangely

Hi Micah,

I would agree to the first part of your message (to move 
getInstanceDocument from <model> to <instance>, actually that already 
works in my implementation), but I have a problem with moving rebuild() 
and recalculate() to <instance>.

The problem is that since we now have the XPath function instance(), 
which links all the instances within a model, it is not really possible 
to rebuild or calculate a single instance. These operations always apply 
to the whole model. In other terms, there is only one calculation engine 
_per_model_.

As what comes to revalidate,  I think it should stay in sync with 
recalculate, since it uses the computed results of the 'constraint' 
propery. For refresh, I don't care.

-mikko


Micah Dubinko wrote:
> Greetings,
> 
> Upon review of the DOM interfaces defined in 7.2, there are some
> seeming inconsistencies, or at least oddities. As currently specified,
> code such as this (JavaScript in this case) would be needed to modify
> instance data through script:
> 
> var modelElem = document.getElementById("id_of_model_element");
> var instDoc = modelElem.getInstanceDocument("id_of_instance_element"); 
> 
> // Perform operations on instDoc
> 
> modelElem.rebuild();
> modelElem.recalculate();
> modelElem.revalidate();
> modelElem.refresh();
> 
> The strange part is that the interface is based on the model element,
> so another idref is needed in the parameter of getInstanceDocument to
> say _which_ instance is needed, within the model. If my recollection
> serves, this goes back to the time when each model had only a single
> instance.
> 
> Further, the four r* methods will cause *all* instances on the given
> model to be rebuilt/recalculated/revalidated/refreshed, which is a
> different level of granularity than getInstanceDocument.
> 
> Request: If the implementers agree, I request that the interface be
> specified as part of the instance element instead, removing the need
> for a parameter on getInstanceData. The previous code would then look
> like:
> 
> var instElem = document.getElementById("id_of_instance_element");
> var instDoc = modelElem.getInstanceDocument(); 
> 
> // Perform operations on instDoc
> 
> instElem.rebuild();
> instElem.recalculate();
> instElem.revalidate();
> instElem.refresh();
> 
> Thanks,
> 
> .micah
> 
> =====
> Find out what the fuss about XForms is all about. Full text of my book in-progress online at http://dubinko.info/writing/xforms/
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com

Received on Thursday, 2 January 2003 05:26:32 UTC