Thusitha Indunil
Thusitha Indunil

Reputation: 832

wso2ei-6.4.0 and XSLT 3.0 support

I am planning to used XSL version 3.0 for my WSO2 EI application. Because, I need to map JSON to JSON and JSON to XML in my application. Currently I have try with version 2.0. Please refer following code for current implementation.

I need to know how change this version and which jar required in WSO2EI for xsl version 3.0.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" />
    <xsl:param name="STATIC_BODY_PARAM"></xsl:param>
    <xsl:template match="/availabilityRequest">

        <availabilityRequest>
            <control>
                <userName>
                    <xsl:value-of select="control/userName" />
                </userName>
                <passWord>
                    <xsl:value-of select="control/passWord" />
                </passWord>
            </control>
             ....................
        </availabilityRequest>

    </xsl:template>
</xsl:stylesheet>

When I used version as 3.0, I got following error message. I have added your further reference.

ERROR - XSLTMediator Error creating XSLT transformer using : Value {name ='null', expression =fn:concat('gov:repository/transformation/',$ctx:uri.var.travel_type,'_',$ctx:uri.var.activity,'_',$ctx:uri.var.supplier_id,'_in.xslt')}
net.sf.saxon.trans.LicenseException: Requested feature (XSLT 3.0) requires Saxon-PE
    at net.sf.saxon.Configuration.checkLicensedFeature(Configuration.java:584)
    at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:331)
    at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:207)
    at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:132)
    at org.apache.synapse.mediators.transform.XSLTMediator.createTemplate(XSLTMediator.java:467)

Upvotes: 0

Views: 756

Answers (2)

Thusitha Indunil
Thusitha Indunil

Reputation: 832

I have fixed above problem using following information.

I have got those details from following link. Many thanks for that. http://nandikajayawardana.blogspot.com/2012/12/how-to-replace-saxonhe940wso2v1jar-in.html

Upvotes: 1

Michael Kay
Michael Kay

Reputation: 163595

I don't know anything specifically about WSO2EI, but it appears (from your link) that it is currently running with some older version of Saxon-HE.

Simply substituting the Saxon 9.9 JAR file for the one that is distributed with the product may work, or it may not. It's very likely to work, but it's possible that the stylesheets, or the calling application, depend on something in Saxon that has changed.

If you've tried something, there's no point telling us it doesn't work. You need to tell us exactly how it failed.

You should try running a stylesheet that outputs the value of system-property('xsl:product-version') so you have positive confirmation of which Saxon version is being picked up.

You don't need to make any changes to your stylesheets to use XSLT 3.0 features, but it's a good idea to change the version attribute to version="3.0" for documentation reasons.

Upvotes: 1

Related Questions