Search code examples
pentahosaxonpentaho-spoonpentaho-data-integrationxslt-3.0

How can I get XSL 3.0 to work with Pentaho XSL Step


I am trying to make use of the XSL 3.0 xml-to-json function in Pentaho but get a compile error when running the transformation.

I believe it’s because Pentaho uses a JAR for XSL 2.0.

I was hoping there is a JAR for XSL 3.0 Pentaho can use that someone can point me to.


Solution

  • Solution arrived at-

    From the Pentaho Data Integration installation path, take out both /lib/saxon-9.1.0.8.jar and /lib/saxon-dom-9.1.0.8.jar; and replace with only Saxon-HE-10.5.jar.

    After that, I was able to get it to work.

    Please note that this function (xml-to-json) only works on specifically formatted XML inputs, and it does not work on arbitrary XML documents:

    https://saxonica.plan.io/boards/3/topics/6299

    https://www.saxonica.com/html/documentation10/functions/fn/xml-to-json.html#:~:text=Converts%20an%20XML%20tree%2C%20whose,Available%20in%20all%20Saxon%20editions

    https://www.altova.com/xpath-xquery-reference/fn-xml-to-json