In a identity transform we can delete an attribute by
this works for any input... And we can \"r
It's difficult to answer your questions because some of your assumptions are wrong. For example:
my new element
works for any number of elements. When applied (together with an identity transform template) to the following input:
the result will be:
my new element
my new element
my new element
So clearly your assertion that "it works only when input have only one element" is not true.
With regard to:
newValue
This does not replace the value of myAttrib because the template matches the attribute - not its value (as an aside: the value of an attribute is not a node and cannot be matched). So just like before, the attribute is matched and another node is output in its place; first it was an element, now it's a text node. That's the only difference.
The "replace procedure" is one attribute-node per one element-node.
No, that's not true either. Consider, for example, the following input:
and the following template:
or:
--
BTW, none of these examples will work with Saxon - but that's another story.