Right now, internally, we depend on xforms-insert and xforms-delete for:
-InstanceMirror
the new support for instance indexes and the id() function
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.
Right now, internally, we depend on
xforms-insert
andxforms-delete
for:-
InstanceMirror
id()
functionIn case of root element replacement, however, it's problematic to have insert
xforms-delete
followed byxforms-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 onxforms-insert
. However,xforms-insert
doesn't give access to the former root element, and so this can mess-upInstanceMirror
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
andxf:delete
, as XQuery does.