xmldom icon indicating copy to clipboard operation
xmldom copied to clipboard

Expose node type constants

Open ksobue opened this issue 9 years ago • 1 comments

This PR will expose Node's type constants which are defined in DOM level 2. User can code the same way as in browser env.

var Node = require("xmldom").Node;

for (var node = xmlElem.firstChild; node !== null; node = node.nextSibling) {
  if (node.nodeType === Node.ELEMENT_NODE) {
    var elem = node;
     ...
  }
}

ksobue avatar Jan 21 '16 05:01 ksobue

Any update on this? It would be nice to utilize the constants in the library.

andrewbober avatar Apr 25 '17 02:04 andrewbober