We have an existing svg-document in witch we want to replace a group-element with a new one. Is it possible to do with Snap.svg?
var oldGroup = Snap.select("[id='" + oldGroupId + "']");
oldGroup.outerSVG(newGroup); //This is what I want to do but outerSVG is readonly
Best How To :
You can't relace an element using just outerSVG. You haven't included enough information to give a complete correct answer, as we can't see what the existing elements, but it may be something like..
var parent = oldGroup.parent();
parent.add( newGroup )
This would depend on what 'newGroup' is. If its a DOM element, I think it would work. If its just some SVG Markup, you would probably need to do something like
parent.add( Snap.parse( newGroup ) );