Help: Error calling .NET method from XSLT
Added by GANESH ILANGOVAN almost 10 years ago
Hi,
i am getting "javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 1 error detected." error when i try to call C# method from XSLT. i am now sure what is wrong in my code. Below are my code, i am using saxon9he-api - v 9.5.1.5. If any one can help me that would be great.
Schematron Rule (calling XSLT method isValidAdmissionDate by passing 2 string values): <sch:rule context="/cda:ClinicalDocument/cda:component/cda:structuredBody/cda:component/cda:section/cda:entry/cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:effectiveTime"> <sch:assert id="10130-1-2" test="isValidAdmissionDate(cda:low/@value,cda:high/@value)"> Encounter Performed Admission Date (low value) is after the Encounter Performed Discharge Date (high value). </sch:assert> </sch:rule> XSLT (i am keeping the below XSLT code in the same schematron file): <xsl:template name="main1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dotnetClassName="clitype:Validation.Schematron?from=../../WinTest/bin/Debug/Validation.dll"> <xsl:param name="versionNeutralId"/> <xsl:param name="versionSpecificId"/> xsl:choose <xsl:when test="dotnetClassName:isValidAdmissionDate($versionNeutralId,$versionSpecificId)"> <xsl:value-of select="true()"/> </xsl:when> xsl:otherwise <xsl:value-of select="false()"/> </xsl:otherwise> </xsl:choose> </xsl:template>
C# Class
namespace Validation
{
public class Schematron
{
public Boolean isValidAdmissionDate(string admit, string discharge)
{
return false;
}
}
}
Thanks, Ganesh
Replies (1)
RE: Help: Error calling .NET method from XSLT - Added by Michael Kay almost 10 years ago
This capability needs Saxon-PE or Saxon-EE.
Please register to reply