Problem: Note that direct calls to Java methods are not available under Saxon-HE

classic Classic list List threaded Threaded
1 message Options
yck
Reply | Threaded
Open this post in threaded view
|

Problem: Note that direct calls to Java methods are not available under Saxon-HE

yck
I transform a schematron schema to xslt using Saxon 9.5 HE and want to call a java function in an assert.

I register my function Using ExtensionFunctionDef interface but get the following error:

Error on line 216
  XTDE1425: Cannot find a matching 0-argument function named
  {java:com.agfa.orbis.ws.hl7validation.business.impl.CustFuncDefinition}test(). Note that
  direct calls to Java methods are not available under Saxon-HE
  at xsl:apply-templates (#200)
     processing /
; SystemID: ; Line#: 216; Column#: -1

my transformed xslt looks like this


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:schold="http://www.ascc.net/xml/schematron"
                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
                xmlns:xhtml="http://www.w3.org/1999/xhtml"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:hl7="urn:hl7-org:v2xml"
                xmlns:cf="java:com.agfa.orbis.ws.hl7validation.business.impl.CustFuncDefinition"
                version="1.0">
   <xsl:param name="archiveDirParameter"/>
   <xsl:param name="archiveNameParameter"/>
   <xsl:param name="fileNameParameter"/>
   <xsl:param name="fileDirParameter"/>
   <xsl:variable name="document-uri">
      <xsl:value-of select="document-uri(/)"/>
   </xsl:variable>
.
.
.
.
.
.
.

<xsl:choose>
         <xsl:when test=" 'testx' = cf:test()"/>
         <xsl:otherwise>
            <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="'testx' = cf:test()">
               <xsl:attribute name="location">
                  <xsl:apply-templates select="." mode="schematron-select-full-path"/>
               </xsl:attribute>
               <svrl:text>
                        test failed
                        </svrl:text>
            </svrl:failed-assert>
         </xsl:otherwise>
      </xsl:choose>



and the registiration

TransformerFactory fac=new TransformerFactoryImpl();
        System.setProperty( PROPERTY_TRAX_IMPLEMENTATION, SAXON_TRAX_CLASS );
        Configuration transConfig1 = ((TransformerFactoryImpl)fac).getConfiguration();
        transConfig1.registerExtensionFunction(new CustFuncDefinition());
        fac.setURIResolver( jur );
        Transformer t = null;


Any suggestion why i get this error Although, i register the function?