Sha256: 0675ac6d8c8c141ae0959f8d54f080306afe016444387c2c110c376aba8bc628

Contents?: true

Size: 791 Bytes

Versions: 45

Compression:

Stored size: 791 Bytes

Contents

var fs = require("fs"),
  util = require("util"),
  path = require("path"),
  xml = fs.readFileSync(path.join(__dirname, "test.xml"), "utf8"),
  sax = require("../lib/sax"),
  strict = sax.parser(true),
  loose = sax.parser(false, {trim:true}),
  inspector = function (ev) { return function (data) {
    console.error("%s %s %j", this.line+":"+this.column, ev, data);
  }};

sax.EVENTS.forEach(function (ev) {
  loose["on"+ev] = inspector(ev);
});
loose.onend = function () {
  console.error("end");
  console.error(loose);
};

// do this in random bits at a time to verify that it works.
(function () {
  if (xml) {
    var c = Math.ceil(Math.random() * 1000)
    loose.write(xml.substr(0,c));
    xml = xml.substr(c);
    process.nextTick(arguments.callee);
  } else loose.close();
})();

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
ela-4.1.6 node_modules/sax/examples/example.js
ela-4.1.5 node_modules/sax/examples/example.js
ela-4.1.4 node_modules/sax/examples/example.js
ela-4.1.3 node_modules/sax/examples/example.js
ela-4.1.2 node_modules/sax/examples/example.js
ela-4.1.1 node_modules/sax/examples/example.js
ela-4.1.0 node_modules/sax/examples/example.js
ela-4.0.0 node_modules/sax/examples/example.js
ela-3.4.3 node_modules/sax/examples/example.js
ela-3.4.2 node_modules/sax/examples/example.js
ela-3.4.0 node_modules/sax/examples/example.js
ela-3.3.1 node_modules/sax/examples/example.js
ela-3.3.0 node_modules/sax/examples/example.js
ela-3.2.0 node_modules/sax/examples/example.js
ela-3.1.1 node_modules/sax/examples/example.js
ela-3.1.0 node_modules/sax/examples/example.js
ela-3.0.0 node_modules/sax/examples/example.js
ela-2.0.0 node_modules/sax/examples/example.js
ela-1.1.0 node_modules/sax/examples/example.js
stylus-source-0.54.5 vendor/node_modules/sax/examples/example.js