npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

saxml

1.0.0 • Public • Published

saxml

Build Status npm version

Simple API for XML in JavaScript.

Usage

let Saxml = require('saxml')
let saxml = new Saxml(strict, options)

saxml.on("error", function (e) {
  console.error("error!", e)

  // clear the error and resume
  this._parser.error = null
  this.resume()
})
saxml.on("opentag", function (d) {
  // process data.
})

fs.createReadStream("foo.xml")
  .pipe(saxStream)

// Or using write and close methods.
// saxStream.write('<foo>bar</foo>').close()

Events

The event names can be exported through the constructor Saxml.

console.log(Saxml.events)

/* [
 *  "text",
 *  "processinginstruction",
 *  "sgmldeclaration",
 *  "doctype",
 *  "comment",
 *  "opentagstart",
 *  "attribute",
 *  "opentag",
 *  "closetag",
 *  "opencdata",
 *  "cdata",
 *  "closecdata",
 *  "error",
 *  "end",
 *  "ready",
 *  "script",
 *  "opennamespace",
 *  "closenamespace"
*/ ]

Keywords

install

npm i saxml

Downloadsweekly downloads

3

version

1.0.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability