Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling java instance methods in XSLT stylesheet

843834Mar 7 2005 — edited Jun 17 2005
HI

I know this has been answered in this forum but I cnanot get it to work.
Before calling the transform() method on my transformer instance I do the following
transformer.setParameter( "Confirm", confirm)
confim is an instance of one of my own classes. I want to get the
XSLT stylesheet to call a method on this object. The method sig is
public void setTitle(String title)
Accordingly in my stylesheet I do the following
<xsl:param name="Confirm"/>
having already declared the java namespace in my stylesheet element as xmlns:java="java", and later on call the setTitle method
<xsl:value-of select="java:setTitle($Confirm,$Title)/>
where $Title is another var generated in the XSLT.

This should work, right? Well I get an error
'The first argument to the non-static Java function 'setTitle' is not a valid object reference.'
But it is as I can do this
<xsl:value-of select="$Confirm"/>
Thanks

Mark
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2005
Added on Mar 7 2005
4 comments
285 views