'url(#' is not enough. SVG also allows for simple references (like '#id'). I think it might be better to look for '#id' references for each renamed id