Cannot find a mathcing 0-argument function named {com.agfa.orbis.ws.hl7validation.business.impl.CustFuncDefinition}test()

classic Classic list List threaded Threaded
2 messages Options
yck
Reply | Threaded
Open this post in threaded view
|

Cannot find a mathcing 0-argument function named {com.agfa.orbis.ws.hl7validation.business.impl.CustFuncDefinition}test()

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

System.setProperty("javax.xml.transform.TransformerFactory",
"net.sf.saxon.TransformerFactoryImpl");
        TransformerFactory transFactory =TransformerFactory.newInstance();

        Configuration transConfig1 = ((TransformerFactoryImpl) transFactory)
                .getConfiguration();

        transConfig1.registerExtensionFunction(new CustFuncDefinition());

        transFactory.setURIResolver(jur);

        Transformer t = null;
....

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



--
View this message in context: http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/Cannot-find-a-mathcing-0-argument-function-named-com-agfa-orbis-ws-hl7validation-business-impl-CustF-tp12232.html
Sent from the saxon-help mailing list archive at Nabble.com.

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Cannot find a mathcing 0-argument function named {com.agfa.orbis.ws.hl7validation.business.impl.CustFuncDefinition}test()

Michael Kay
I can't see immediately what's wrong here. It would be useful to see what's in the relevant class (e.g. how the function name and arity are defined).

Using the -TJ option on the command line, or the equivalent Configuration option in the API (FeatureKeys.TRACE_EXTERNAL_FUNCTIONS), can help to reveal why functions were not found,

One possibility is that the system has got confused by your choice of namespace URI, which follows the conventions for "reflexive extension functions". It should be possible to use any URI, but there's always the possibility that the code has gone down the wrong path.

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help