xmldom
xmldom copied to clipboard
Expose node type constants
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;
...
}
}
Any update on this? It would be nice to utilize the constants in the library.