Don’t create transforms with some specific node as constructor argument. Start a state transaction (view.state.tr) and update the content of the entire document in that.
let tr = this.outerView.state.tr.setNodeAttribute(this.getPos()+1, 'src', 'new_file_src');
this.outerView.dispatch(tr);
This works, but I don’t know how to reliably get the position of a node’s position relative to its parent.
Here I’m using getPos() +1 to change the first child, but if I need to change the 5th child, How can I know its position? There doesn’t seem to be a function to return a node’s position. Am I missing anything? Thank you.