a simple XSLT addon for node
C++ C JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits ahead, 39 commits behind bsuh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
macros.h
node_xslt.cc
package.json
scopeguard.h
test.js
wscript

README.md

node_xslt

xslt = require('node_xslt')
fs = require('fs')

fs.readFile('test.xsl', function (err, xsltString) {
    if (err) throw err;

    stylesheet = xslt.readXsltString(xsltString);

    fs.readFile('cdcatalog.xml', function (err, xmlString) {
        if (err) throw err;

        doc = xslt.readXmlString(xmlString);
        transformedString = xslt.transform(stylesheet, doc, []);
        console.log(transformedString);
    });

    fs.readFile('cdcatalog.html', function (err, htmlString) {
        ir (err) throw err;

        doc = xslt.readHtmlString(htmlString);
        transformedString = xslt.transform(stylesheet, doc, []);
        console.log(transformedString);
    });
});

Requirements

  • libxml2
  • libxslt
  • xml2-config (Needs to be on PATH)
  • node-waf & v8.h (Both come with node)

Installation

npm

npm install node_xslt

source

In the root directory, run `node-waf configure build` to generate
./build/default/node_xslt.node