Rajit Garg
Rajit Garg

Reputation: 539

node_xslt documentation or examples not available

Hello,

I am new to xml, xsl, but I want to use node_xslt to Transform XML documents.

I have seen the nodejs page for this https://www.npmjs.com/package/node_xslt and https://developer.mozilla.org/en-US/docs/XSLT/PI_Parameters, but it does not contains any example, so can someone provide me some link or examples through which I can understand about this..

Upvotes: 0

Views: 213

Answers (1)

Rajit Garg
Rajit Garg

Reputation: 539

Thank you very much , I have got answer of my question,

The Link http://www.tutorialspoint.com/xslt/xslt_syntax.htm is very useful,

I have require to do just the following

var xslt = require('node_xslt');

var document = xslt.readXmlFile('path of xml file');

var stylesheet = xslt.readXsltFile('path of xslt file');

var transformedString = xslt.transform(stylesheet, document, []);

This will give us the HTML by using xml and xslt, can be check by print this..

console.log("transformedString>>>>" + transformedString);

Upvotes: 1

Related Questions