export.js 517 B

1234567891011121314
  1. (f = function(node) {
  2. if (node.nodeName === "#text") {
  3. handler.onTxt(node.data);
  4. } else if (node.nodeName === "#comment") {
  5. handler.onCom(node.data);
  6. } else {
  7. var atts = node.attributes;
  8. var count = atts.length;
  9. for (var i = 0; i < count; i++) handler.onAttr(atts[i].name, atts[i].value);
  10. handler.onNew(node.nodeName);
  11. for (var n = node.firstChild; n !== null; n = n.nextSibling) f(n);
  12. handler.onEnd(node.nodeName);
  13. }
  14. })(document.body);