Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert xml to html using XSLT stylesheet in node.js

Has anyone tried to convert xml file into html webpage using XSLT stylesheet in node.js? My background is in Java. I normally use SAXON to convert XML into HTML webpages. I am a newbie to node.js. I have tried to implement this using few libraries like node_xslt, libxsltjs etc but was not successful. If anyone has tried using other libraries that works with XSLT stylesheet, please post a link. Any help would be appreciated.

like image 406
Rose Avatar asked Oct 19 '22 10:10

Rose


1 Answers

If you want to use Saxon from a Node.js application, you basically have three choices, none of them ideal:

(a) call out to Java, using a variety of mechanisms.

(b) use the port of Saxon/C to Node.js being constructed here: https://github.com/rimmartin/saxon-node This is bleeding-edge stuff and I don't know how far the project has got.

(c) wait for Saxon-JS to arrive any time soon. See http://dev.saxonica.com/blog/mike/2016/02/introducing-saxon-js.html

like image 162
Michael Kay Avatar answered Oct 21 '22 04:10

Michael Kay