Gary,
I am working on this at home but am at work at the moment so I will try   
it tonight. It is one (of the numerous) things I haven't tried yet.

I am doing this in XSLT at the moment and haven't explored using XSP yet.   
I am attempting to produce a calendar type application from a simple XML   
document. All the logic for processing is in the XSL file so I can simply   
pass the date, display type (week or month) as query string parameters   
which <xsl:param> can use to determine what to display. I need the java   
extension functions so I can fill in the blanks for beginning and end of   
months i.e. if the 1st of the month begins on Wednesday, I have Sun, Mon   
etc. to fill from previous month. Also, I need to be able to construct   
the blank month calendars where there isn't any events in the XML   
document.

This is all of a bigger goal of producing calendars from Lotus Domino   
applications.

If you like I can send the XML and XSL files when I get home.
Conrad

 ----------
From:  cocoon-users[SMTP:[EMAIL PROTECTED]]
Sent:  04 January 2002 12:41
To:  "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject:   RE: Java named constants in method call



Does

<... select="java.getMaximum($cal,
java.util.GregorianCalendar.DAY_OF_MONTH)" />

work?

BTW, I would very much like to see a larger example of your usage of Java
objects from within XSL. Are you using this in an XSP, or in a   
transformer
stage?

 -----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 7:30 AM
To: [EMAIL PROTECTED]
Subject: Java named constants in method calls




Hi,
I am very new to XSL and Cocoon but I don't think that this is too stupid   
    

a question so here is the problem...

I have instantiated a new java GregorianCalendar object

<xsl:variable name="cal" select="java:java.util.GregorianCalendar.new()"   
    

/>

which works fine. I can also get the date from this using the getTime()   
    

method

... select="java:getTime($cal)" />

what I can't work out is how to use other methods of the
GregorianCalendar class where named constants are used. For example I
want to get the last day of the current month using the getMaximum method   
    

which in java would be
cal.getMaximum(DAY_OF_MONTH), however, I passing the args of DAY_OF_MONTH   
    

using the java extended syntax doesn't work. I can get the method to
return something when I use an integer value for the args, but not the
named constant.

... select="java.getMaximum($cal, DAY_OF_MONTH)" />   doesn't work (ie.   
    

returns 0)
... select="java.getMaximum($cal, 6)" /> ----- returns 366 so presumably   
    

6 is the integer for YEAR


I imagine I could get hold of the source code for GregorianCalendar and   
    

establish what the integer values are from there but surely there must be   
    

a way of using the named constant?

Any help would be very much appreciated.
Conrad

 ---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

 ---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>



---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to