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.
buf += "&lt;";
        break;
      case '"':
        buf += "&quot;";
        break;
      case "\n":
        buf += "&#xA;";
        break;
      case "\r":
        buf += "&#xD;";
        break;
      case "\t":
        buf += "&#x9;";
        break;
      default:
        buf += ch;
        break;
    }
  }
  return buf;
}
function DOMElement(name) {
  this.nodeName = name;
  this.childNodes = [];
  this.attributes = {};
  this.textContent = "";
  if (name === "style") {
    this.sheet = {
      cssRules: [],
      insertRule(rule) {