XLink Property in SVG textPath Nodes

Ran into a problem today with attempting to manipulate textPath SVG elements within the DOM. Consider the following, where the variable svg is an SVG element in your DOM: var g = document.createElementNS(“http://www.w3.org/2000/svg”, “g”); var label_container = document.createElementNS(“http://www.w3.org/2000/svg”, “text”); var label = document.createElementNS(“http://www.w3.org/2000/svg”, “textPath”); label.setAttributeNS(“http://www.w3.org/1999/xlink”, ‘xlink:href’, ‘#some-path’); label.appendChild(document.createTextNode(“Hello, World!”)); label_container.appendChild(label); …