how to configure wso2esb to use Saxon 9.8 HE

Viewed 75

I'm trying to use the XSLT Mediator using XSLT version "3.0".but i can't use following XSLT transformation.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
xmlns:array="http://www.w3.org/2005/xpath-functions/array"
exclude-result-prefixes="#all"
version="3.0">

  <xsl:output version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="true"/>

  <xsl:variable name="data" select="//return => json-to-xml()"></xsl:variable>
<xsl:template match="/" xpath-default-namespace="http://www.w3.org/2005/xpath-functions">
    <ns1:root xmlns:ns1="http://urldata.com/ns1">
        <ns1:MessageData>
            <xsl:value-of select="$data//boolean[@key = 'accountstatus']"/>
        </ns1:MessageData>
        <ns1:Code>
            <xsl:value-of select="$data//map[@key = 'response']/string[@key = 'Code']"/>
        </ns1:Code>
        <!--- use this approach for everything you want to select ... -->
    </ns1:root>
  </xsl:template>
</xsl:stylesheet>

The error i'm getting is: net.sf.saxon.trans.LicenseException: Requested feature (XSLT 3.0) requires Saxon-PE

2 Answers

get Saxon-HE 9.8 using below URL

https://sourceforge.net/projects/saxon/files/Saxon-HE/9.8/

And download most downloaded version and put it below path to your esb configuration

wso2esb-4.9.0/lib/

and restart the service

XSLT 3.0 was supported in the commercial versions of Saxon while it was still under development, but support moved into the open source version Saxon-HE only when the W3C spec was finalised. Try a later version of Saxon - the current version is 10.3.

Related