Need to transform XML based on some XSL files using net.sf.saxon.transformerfactoryimpl
XSL file is referring to some extension functions defined in XSL under xmlns sections as
xmlns:rad ="http://mywebsite.com/saxon-extension"
when I execute my code on local machine, everything works fine and there is no error. when the same code is deployed in AWS centos there is no error and the transformed document is not correct. is there any issue with SAXON in AWS, centos do I need to enable some External URL's defined in XSL
Transformer:
TransformerFactory transformerFactory = TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl",null);
if(transformerFactory instanceof net.sf.saxon.TransformerFactoryImpl)
{
Configuration configuration =((net.sf.saxon.TransformerFactoryImpl)transformerFactory).getCOnfiguration();
SaxonExtensionFunctionRegistery.registerAll(configuration);
}
registerALL Method:
for (class c:extensionFunction)
{
try {
configuration.registerExtensionFunction((ExtensionFunctionDefination)c.newInstance());
}
catch(Exception ex) {
log.error("Error registering extension function:",c.getName(),ex);
}
}
xsl declartion and function:
xmlns:functx="http://www.functx.com" xmlns:rad="http://mywebsite.com/saxon-extension" excluse-result-prefixes="dicom xs rad functx"
<xsl:function name ="dicom:getAccessionNo">
<xsl:param name="dicomNode"/>
<xsl:choose>
<xsl:otherwise>
<xsl:value-of select="dicom:getElement($dicomNode/attr[@tag='00080050'],rad:getResouce('StudyProcessing','unknownLabel'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
xsl:function
? Or extension functions implemented in Java? Anyway, consider to add minimal but complete samples of XML, XSLT, Java, result you want and the one you get together with exact details of the Saxon edition and version. – Martin Honnen