I am using Fuse 6.1 and camel 2.12 version for my project and facing following problem. I am trying to pass java.util.HashMap to my xslt and accessing map to retrieve bunch of values in my XSLT. For this i am constructing a map and placing it the in header in a bean and accessing it XSLT. I created a test case to run this route and everything is working fine, able to access map in XSLT, XSLT is compiling fine and generating expected XML if i had net.sf.saxon/saxon/8.9.0.4 in my class path but if i try to deploy same route in fuse 6.1 which has camel-saxon feature, its failing with following error. Later i realized and replaced net.sf.saxon jar file with camel-saxon dependency in pom file and test case for the same route is failing. Question is how can i make it run using camel-saxon feature.
Here is my route
<route id="newCustomerMapToXmlTransformationRoute">
<from uri="direct:newCustomerMapToXmlTransformation" />
<to uri="customerIdGenerationProcessor" />
<to uri="xslt:xslt/flatFileToCustomer.xsl?transformerFactory=tFactory&failOnNullBody=false" />
<removeHeader headerName="customerProfileMap" />
</route>
XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:Map="java.util.HashMap" exclude-result-prefixes="Map"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
<xsl:variable name="sourceName" select="Map:get($customerProfileMap,'aaaa')"/>
</xsl:stylesheet>
Getting following error:
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
[ main] XsltErrorListener ERROR Cannot find a matching 2-argument function named {java.util.HashMap}get(). Note that direct calls to Java methods are not available under Saxon-HE;
net.sf.saxon.trans.XPathException: Cannot find a matching 2-argument function named {java.util.HashMap}get(). Note that direct calls to Java methods are not available under Saxon-HE
I spent lot of time to find a solution and could not find any. Can any one help me solve this issue? Does it make sense to uninstall camel-saxon feature from fuse and use net.sf.saxon jar?