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