Question

XML to JSON, XSLT transformer issue

  • 12 February 2021
  • 2 replies
  • 302 views

Userlevel 2
Badge +5

I could convert xml data set to json format using attached xslt transformer, I tested trasformer using online tools and it’s working fine for online tools.

But when I am using that transformer from the IFS for the same data set( same format ), the application msg is giving below error.

 

In my xslt I use “xml-to-json” to print the data

 

What should I do for this issue?


This topic has been closed for comments

2 replies

Userlevel 4
Badge +8

IFS only supports basic xslt Version 1.0. 

 

I believe you are using functions from a newer version of XSLT.

 

Userlevel 7
Badge +20

IFS only supports basic xslt Version 1.0. 

 

I believe you are using functions from a newer version of XSLT.

 

IFS uses the XALAN (Xalan-Java Version 2.7.1 (apache.org)) xsl engine which supports only xslt 1.0 

Seems the function  xml-to-json  is part of xslt 3.0 spec, which caused the error.

As a simple answer to your question,  you can’t use xml-to-json function and has to use the ‘old school’ way for xml to json transformation.

Some good reading in SOF: xsl to convert xml to json - Stack Overflow

Otherwise you can create a java transformer instead xsl where you can easily convert xml to json using a preferred library like Json-java by stleary 

 

At the mean time I hope this will be a good point for IFS RnD to think of upgrading the xsl engine  ;)

 

Cheers!

Damith