You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by li...@digitalrum.com on 2001/06/13 11:27:53 UTC

problems with xsp date

Hi all

I'm trying to create a simple XSP page that gets the current hour and minute
and passes it on to a stylesheet. The cocoon docs say XSP automatically
generates import statements for the most commonly used Java libraries
(including java.util.Date).

However when I try run the page I get an error: Type expected.
now.setTime(new Date());

Has anybody got any ideas?

Here is the relevant part of the page:

   	<xsp:logic>
       Calendar now = Calendar.getInstance();
        now.setTime( new Date() );
        float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 * 360; 
        float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 * 360;
      </xsp:logic>

	<time>

     	<hour><xsp:expr>hourAngle</xsp:expr></hour>
       <minute><xsp:expr>minAngle</xsp:expr></minute>

	</time>

thanks in advance!

Lisa

---------------------------------------------------------------------
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>