If $x is an instance of class java.util.Date and you want to call its toString() method, then you do
 
date:toString($x)
 
where xmlns:date="java:java.util.Date".
 
If your method has additional arguments, for example Date.before(Date) then you can add these:
 
date:before($x, $y)
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of martin.me.roberts@bt.com
Sent: 20 May 2008 11:52
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] Accessing a method from a variable

if I have an xslt variable of type 'x' and later in the sheet I want to call a method on that variable how do you do that?
 
An example is your sql one but there you pass the connection into a function not call a function on it?
 
Martin


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Michael Kay
Sent: 20 May 2008 11:47
To: 'Mailing list for the SAXON XSLT and XQuery processor'
Subject: Re: [saxon] Accessing a method from a variable

The documentation for this case is here:
 
http://www.saxonica.com/documentation/extensibility/functions/instance-methods.html
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of martin.me.roberts@bt.com
Sent: 20 May 2008 11:40
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Accessing a method from a variable

If I return a java object instance as a variable, what is the syntax to call a method on that object?