bsuh / node_xslt

a simple XSLT addon for node
zlib License
71 stars 17 forks source link

node_xslt

Installation

npm install node_xslt --save

Or:

In the root directory, run node-gyp rebuild to generate ./build/Release/node_xslt.node

Then:

var xslt = require('node_xslt')

Requirements

API

Method Arguments Return Description
readXsltString string Stylesheet {} Uses the specified XSLT for transformation
readXsltFile string Stylesheet {} Loads the XSLT from file
readXmlString, readHtmlString string Document {} Imports XML/HTML from string
readXmlFile, readHtmlFile string Document {} Imports the XML/HTML file
transform Stylesheet, Document, string[] string Transforms the document

Example

xslt.transform(
  stylesheet,
  document,
  [
    'paramName',
    'paramValue',
    'paramName',
    'paramValue'
  ]
)