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')
- 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)
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 |
xslt.transform(
stylesheet,
document,
[
'paramName',
'paramValue',
'paramName',
'paramValue'
]
)