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"
*/ ]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i saxml

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

38.3 kB

Total Files

7

Last publish

Collaborators

  • derekchuank