/node_xslt

a simple XSLT addon for node

Primary LanguageC++zlib LicenseZlib

node_xslt

xslt = require('node_xslt')

stylesheet = xslt.readXsltString(string);
// readXsltString
// Arguments: string containing XSLT
// Returns: stylesheet object

stylesheet = xslt.readXsltFile(filename);
// readXsltFile
// Arguments: filename to file containing XSLT
// Returns: stylesheet object

document = xslt.readXmlString(string);
// readXmlString
// Arguments: string containing XML
// Returns: document object

document = xslt.readXmlFile(filename);
// readXmlFile
// Arguments: filename to file containing XML
// Returns: document object

htmlDocument = xslt.readHtmlString(string);
// readHtmlString
// Arguments: string containing HTML
// Returns: document object

htmlDocument = xslt.readHtmlFile(string);
// readHtmlFile
// Arguments: filename to file containing HTML
// Returns: document object

transformedString = xslt.transform(stylesheet, document, parameters);
// transform
// Arguments:
//  * stylesheet: stylesheet object
//  * document: document object
//  * parameters: an array of parameters to be passed to the stylesheet. length must be multiple of 2.
//        Example: ['param1Name', 'param1Value', 'param2Name', 'param2Value']

Requirements

  • libxml2 (libxml2-dev package for Debian-based distros)
  • libxslt (libxslt-dev package for Debian-based distros)
  • libexslt (libxslt-dev package for Debian-based distros)
  • 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