orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
518 stars 220 forks source link

Support xxforms-replace event #837

Closed ebruchez closed 11 years ago

ebruchez commented 11 years ago

Right now, internally, we depend on xforms-insert and xforms-delete for:

-InstanceMirror

In case of root element replacement, however, it's problematic to have insert xforms-delete followed by xforms-insert, because this hints via events that at some point, the instance doesn't have a root element (which is not allowed by XForms at this point). In fact, the replacement operation is atomic from the point of view of external observers.

Because we don't want this situation where we seemingly don't have a root element, we don't dispatch xforms-delete in case of root element replacement, and we rely on xforms-insert. However, xforms-insert doesn't give access to the former root element, and so this can mess-up InstanceMirror and instances indexes as we don't know that an element was replaced.

So we propose adding xxforms-replace to handle this case.

Later, we should also add a proper replacement action in addition to xf:insert and xf:delete, as XQuery does.

ebruchez commented 11 years ago

Implemented with b62f7330483b693426b271917c9547ae5c48b6d5.