Nebulous Program Mechanic

    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

    1

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    38.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • derekchuank