Calling a non-static method from xsl stylesheet.
843834Aug 18 2006 — edited Dec 23 2008Hi all,
My xsl is as follows.I am trying to call non-static method CallforImage from NNTPClient java class.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:nntp="cox.apfeeds.NNTPClient" extension-element-prefixes ="nntp">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:element name="nitf">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="/nitf/head">
<xsl:element name="head">
<xsl:variable name="NNTPClient" select="nntp:new()"/>
<xsl:template match="/nitf/body/body.content/block/media/media-reference">
<xsl:element name="media-metadata">
<xsl:attribute name="dtiname">
<xsl:variable name='pdata' select="@data-location" /> <xsl:variable name = "imageresult" select = 'substring-after($pdata,"ap.org/")'/>
<xsl:value-of select="nntp:callForImage($imageresult)"/> </xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
</xsl:element>
</xsl:template>
The error I am getting is
The first argument to the non-static Java function 'cox.apfeeds.NNTPClient.callForImage(string)' is not a valid object reference.'
Can anybody pls help me.Any help greatly appreciated.