How to use the entities.decodeXML function in entities

To help you get started, we’ve selected a few entities examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timonreinhard / wemo-client / client.js View on Github external
attributeList: function(data) {
      var xml = '' + entities.decodeXML(data) + '';
      xml2js.parseString(xml, { explicitArray: true }, function(err, result) {
        if (!err) {
          // In order to keep the existing event signature this
          // triggers an event for every attribute changed.
          result.attributeList.attribute.forEach(function(attribute) {
            self.emit('attributeList',
              attribute.name[0],
              attribute.value[0],
              attribute.prevalue[0],
              attribute.ts[0]
            );
          });
        }
      });
    }
  };
github voidberg / eslint-bamboo-formatter / util.js View on Github external
result.messages.forEach(function iterator(message) {
    msg.push(counter + '. line ' + message.line + ', column ' + message.column + ': ' + decodeXML(message.message));
    counter++;
  });
github mdevils / node-html-entities / benchmark / benchmark.js View on Github external
    'entities.decodeXML': function () { entities.decodeXML(textToDecode); },
    'entities.decodeHTML4': function () { entities.decodeHTML4(textToDecode); },
github timonreinhard / wemo-client / client.js View on Github external
this.soapAction('urn:Belkin:service:deviceevent:1', 'GetAttributes', null, function(err, data) {
    if (err) return cb(err);
    var xml = '' + entities.decodeXML(data.attributeList) + '';
    xml2js.parseString(xml, { explicitArray: false }, function(err, result) {
      if (err) return cb(err);
      var attributes = {};
      for (var key in result.attributeList.attribute) {
        var attribute = result.attributeList.attribute[key];
        attributes[attribute.name] = attribute.value;
      }
      cb(null, attributes);
    });
  });
};
github mdevils / node-html-entities / benchmark / benchmark.js View on Github external
    'entities.decodeXML': function () { entities.decodeXML(littleTextToDecode); },
    'entities.decodeHTML4': function () { entities.decodeHTML4(littleTextToDecode); },
github mdevils / node-html-entities / benchmark / benchmark.js View on Github external
    'entities.decodeXML': function () { entities.decodeXML(emptyTextToDecode); },
    'entities.decodeHTML4': function () { entities.decodeHTML4(emptyTextToDecode); },
github wikimedia / restbase / lib / mwUtil.js View on Github external
mwUtil.extractRedirect = (html) => {
    const redirectMatch = redirectRegEx.exec(html);
    if (redirectMatch) {
        return decodeURIComponent(entities.decodeXML(redirectMatch[1]));
    } else {
        return null;
    }
};
github hcoona / hexo-renderer-asciidoc / lib / renderer.js View on Github external
$('.highlight code').each(function(index, elem) {
    options.lang = elem.attribs['data-lang'];
    var code = entities.decodeXML($(elem).text());
    var content = util.highlight(code, options);
    $(elem).html(content);
  });