You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Malay Das <ma...@yahoo.com> on 2002/03/20 20:46:00 UTC

Extension functions

Hi,

I am trying out the extension function to print out the current date - with
these.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns="http://www.brandsoft.com"
		xmlns:Date="java:java.util.Date"
		version="1.1">
<xsl:script language="java" implements-prefix="Date"
src="java:java.util.Date"/>
..
..

Today's Date :: <xsl:value-of select="Date:toString(Date:new())"/></td>

I am getting this error in component log -

javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: Instance method call to method new
requires an Object instance as first argument

is not new a special function interpreted as constructor..... whats wrong..

-md


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Extension functions

Posted by "Graeme Andrews (BT)" <g....@btinternet.com>.
With Cocoon 2.0.2, I did this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:dt="java.util.Date"
			   	  extension-element-prefixes="dt" >

And used this :

<xsl:value-of select="dt:new()" />


Graeme

-----Original Message-----
From: Malay Das [mailto:magur_cocoon@yahoo.com]
Sent: 20 March 2002 19:46
To: cocoon-users@xml.apache.org
Subject: Extension functions


Hi,

I am trying out the extension function to print out the current date - with
these.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns="http://www.brandsoft.com"
		xmlns:Date="java:java.util.Date"
		version="1.1">
<xsl:script language="java" implements-prefix="Date"
src="java:java.util.Date"/>
..
..

Today's Date :: <xsl:value-of select="Date:toString(Date:new())"/></td>

I am getting this error in component log -

javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException: Instance method call to method new
requires an Object instance as first argument

is not new a special function interpreted as constructor..... whats wrong..

-md


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>