a simple XSLT addon for node
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitignore
LICENSE.txt
README.md
binding.gyp
macros.h
node_xslt.cc
package.json
scopeguard.h
wscript

README.md

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

  • 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)

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'
  ]
)