[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Getting the Date

Subject: Getting the Date
From: Mark Swardstrom <mark@xxxxxxxxxx>
Date: Tue, 20 Feb 2001 09:50:54 -0800
getting the date in java
I'm trying to get the date into XSL via java extensions with the following
code...

<xsl:template name="show-date" xmlns:java="http://xml.apache.org/xslt/java">
	<xsl:variable name="calendar"
select="java:java.util.Calendar.getInstance()"/>
	<xsl:variable name="day"
select="java:java.util.Calendar.get($calendar,
java:java.util.Calendar.DAY_OF_MONTH)"/>
	<xsl:value-of select="$day"/>
</xsl:template>

/* I'll expand this once I start getting something back */

Does anyone have a thought what I am doing wrong?  The following is the
error I'm receiving...

Call to extension function failed: method call/new failed:
java.lang.NoSuchMethodException: static java.util.Calendar.get(java.uti
l.GregorianCalendar,java.lang.Double) -- no signature match

The get function is expecting an Integer (not a Double), but I can't seem to
find a way to force the integer case (I tried round() with no luck).	

If you've tried this, or found another way to get the month, day-of-month,
and year, I'd appreciate your thoughts.  One other thing, I haven't been
able to use the example in Mike Kay's book, I'm using java 1.3 and the date
class isn't available.

Thanks.

- Mark

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.