Re: Inserting attributes

The easy way to understand `insert` is as follows:

- use `context` to signify "into"
- use `ref` to mean "next to"
- use both `context` and `ref` to mean "into but before or after this other
child node if present".

For attributes, I'd recommend always using `context` as attributes are
unordered in the data model.

Your example should be:

    <insert context="test" origin="instance('template')/test/@*"/>

We do have an extensive list of examples:


https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Patterns_for_Data_Mutations_.28Non-Normative.29

Having an explicit `into` attributes could make things clearer.

-Erik

Received on Wednesday, 2 June 2021 17:07:08 UTC