3

I used to use XML / XSLT to transform xml data to various formats and make the result conform to certain patterns using XSD. I found it to be very powerful. We now deal mainly with json data - and I see that there is an XSLT 3.0 version that supports json transformation. Saxon and QuiXSLT ( java ) and Exselt ( .Net ) support xslt 3.0 but first 2 are commercial versions and hellishly expensive.

Is there an alterntive to XSLT that supports transforming json data to json ( or other formats like HTML , CSV ) in node.js? Preferably free or not prohibitively expensive. Or maybe there is a free processor for xslt 3 that supports node.js

Thanks Marty

Martin Thompson
  • 3,415
  • 10
  • 38
  • 62
  • 2
    Saxon 9.8 HE is open-source and supports XSLT 3.0 including the map and array data types of XPath 3.1 to represent JSON data and the various conversion functions specified in XSLT 3.0 and/or XPath 3.1 functions. Whether it is available for node.js I am not sure, the Saxon-C version has been recently updated to 9.8 at least. – Martin Honnen Oct 08 '17 at 20:41
  • Thanks. Ok a bit hard to see how limited the HE version is. Having worked with previous versions - I am not sure if some of the things I was used to there are limited in this version. seems like most of them are available though. It would be good if there was a json alternative to this! – Martin Thompson Oct 08 '17 at 21:39
  • take a look at this maybe https://www.npmjs.com/package/jsonpath-object-transform however i think it's abandoned – Tuan Anh Tran Oct 09 '17 at 01:53
  • 1
    http://www.saxonica.com/products/feature-matrix-9-8.xml is an overview and comparison, in terms of functionality there is no support in HE for schema-aware transformations, streaming, higher-order functions, dynamic XPath evaluation (i.e. `xsl:evaluate`) and backwards compatibility (9.8 HE no longer runs `version="1.0"` stylesheets). I don't see anything restricting the use of JSON respectively XPath 3.1 maps/arrays. – Martin Honnen Oct 09 '17 at 10:21

0 Answers0