You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Andy Chambers <ac...@googlemail.com> on 2008/04/25 15:58:03 UTC

exslt func problem

I think I'm being stupid here so I'd be grateful if someone were to help me out.

I'm trying to write the simplest function that could possibly work,
and it doesn't. When I run this, against any input, I get
"javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: Instance method call to
method func requires an Object instance as first argument".

Here's the stylesheet...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:my="http://formedix.com/functions"
                xmlns:ex="http://exslt.org/common"
                xmlns:func="http://exslt.org/func"
                xmlns:dyn="http://exslt.org/dynamic"
                extension-element-prefixes="ex func dyn">

  <func:function name="my:func">
    <func:result select="'hi'"/>
  </func:function>

  <xsl:template match="/">
    <test-output>
      before
      <xsl:value-of select="my:func()"/>
      after
    </test-output>
  </xsl:template>

</xsl:stylesheet>		

--
Andy

Re: exslt func problem

Posted by Andy Chambers <ac...@googlemail.com>.
On Fri, Apr 25, 2008 at 3:25 PM, Michael Ludwig <ml...@as-guides.com> wrote:

>  The correct namespace is "http://exslt.org/functions" :-)

That fixed it.  Thanks.

--
Andy

Re: exslt func problem

Posted by Michael Ludwig <ml...@as-guides.com>.
Andy Chambers schrieb:
> I'm trying to write the simplest function that could possibly work,
> and it doesn't. [...]

> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 xmlns:my="http://formedix.com/functions"
>                 xmlns:ex="http://exslt.org/common"
>                 xmlns:func="http://exslt.org/func"

The correct namespace is "http://exslt.org/functions" :-)

Michael