https://github.com/mozilla/pdf.js/blob/9bed695ebde488b49d39290087f72ba224bd1078/examples/node/domstubs.js#L84-L87
```javascript
  setAttributeNS: function DOMElement_setAttributeNS(NS, name, value) {
    value = value || '';
    value = xmlEncode(value);
    this.attributes[name] = value;
```

https://github.com/mozilla/pdf.js/blob/9bed695ebde488b49d39290087f72ba224bd1078/examples/node/domstubs.js#L105

```javascript
      buf.push(' ' + i + '="' + xmlEncode(this.attributes[i]) + '"');
```

One of the two should be removed. Most likely the first one, because `getAttributeNS`'s implementation just returns `this.attributes[i]`, and that should not be encoded.
return "<" + node.nodeName;
      case 1: 
        ++this._state;
        if (node.nodeName === "svg:svg") {
          return (
            ' xmlns:xlink="http://www.w3.org/1999/xlink"' +
            ' xmlns:svg="http://www.w3.org/2000/svg"'
          );
        }
      
      case 2: 
        ++this._state;
        this._loopIndex = 0;
        this._attributeKeys = Object.keys(node.attributes);
      
      case 3: 
        if (this._loopIndex < this._attributeKeys.length) {
          const name = this._attributeKeys[this._loopIndex++];
          return " " + name + '="' + xmlEncode(node.attributes[name]) + '"';
        }
        ++this._state;
        return ">";
      case 4: 
        if (node.nodeName === "svg:tspan" || node.nodeName === "svg:style") {
          this._state = 6;
          return xmlEncode(node.textContent);
        }
        ++this._state;
        this._loopIndex = 0;