We need to add strict and stable rules to the spec to specify how more than one activity elements should be executed (order, dependenies, conflicts).
I wrote down a concept, how I think it should work. I think with these rules we get the most intuitive result. Please let me know how you think about it.
Action Order in sqf:fix
Basic principes
- Delete = empty replace.
- All actions should be executed based on the original source document
- Created nodes should be inserted once and no more been touched by other actions
- Inserted nodes should not have an effect on other actions
- A replacing can have the effect that other actions are skipped.
- The order of the actions should only have an effect at the result, if two actions are pointing to the same node.
Rules
- All nodes will get an unique ID (-> as meta data in XDM?).
- A copy of a node does not copy the ID
- Convert the XPaths (in
match attribute) of the action elements into ID references
- An action will be executed only on the node with the referred ID
- Execute the actions in any order, only the following rules needs to be respected.
- If more than one action are pointing at the same anchor node:
- Handle the actions in this order:
- All add actions with position before or after
- All the replace action(s)
- Any other add action (skip if a replace exists, see 2.1.)
- If more than one add action are pointing at the same anchor node:
- Execute all, depending on the order of the actions elements and there position attribute (open discussion what this exactly means)
- If more than one replace action are pointing at the same anchor node, there is a conflict
- If more than one action create for the same element more than one attribute with same names, there is a conflict