Sorry, I changed the URI from xfn to adr like this:
declare namespace adr="java:org.Interface.Adress";

2010/6/28 maha maalej <>


I'm using saxon9he for compilating my xquery into my java application.

I have an XQUERY query that work well until I add an external function call. This function is written in java.  


This is the Java function: 


package org.Interface;

public class Adress {  
    private String adress;

    public String getAdress() {
        try {
            InetAddress iadr = InetAddress.getLocalHost();        
            adress = iadr.getHostAddress();        
        }catch(Exception exp) {

 return adress;
} }


and this is the Java function call in my query (with saving this query in the same folder as the Java function):


declare namespace xfn="org.Interface";


I tried this too for the namespace but no result:


declare namespace xfn="java:Adress?path=file:///C:/CMR/src/org/Interface/";

and this too

declare namespace xfn="java:org.Interface";







 However , I get this error


XPST0017: Cannot find a matching 0-argument function named


; SystemID: file:/C:/CMR/DCU/test.xmi; Line#: 98; Column#: -1

net.sf.saxon.trans.XPathException: Cannot find a matching 0-argument function named {java:org.Interface}getAdress()

        at net.sf.saxon.query.UnboundFunctionLibrary.bindUnboundFunctionCalls(

        at net.sf.saxon.query.QueryModule.bindUnboundFunctionCalls(

        at net.sf.saxon.instruct.Executable.fixupQueryModules(

        at net.sf.saxon.query.QueryParser.makeXQueryExpression(

        at net.sf.saxon.query.StaticQueryContext.compileQuery(

        at net.sf.saxon.query.StaticQueryContext.compileQuery(


Thank you in advance for any help.


With best regards.