list4xt : Mailing list for the XT users community.
[list4xt] Re: illegal arguments error?
Subject: [list4xt] Re: illegal arguments error?
From: Eric van der Vlist (vdv@dyomedea.com)
Date: 28/05/2001 - 17:57
Graham Stephenson wrote:
>
> Hello all,
>
> I'm trying to use a GregorianCalendar object in my stylesheet but I keep
> getting the error message 'set:illegal arguments' when I try to run it
> through xt. (Saxon doesn't complain but returns incorrect results, that is,
> it returns 1 for each of the three date fields.) Am I not passing arguments
> to the method set(int, int, int) correctly?
I am afraid not ;=)
XT is very strict on the datatypes and does almost no implicit
conversion.
There is a mapping table in the documentation [1] that shows that no
XSLT type is mapped to the Java int and you need to do the explicit
conversion (you can try using the intValue method of the java type
Double) or to write a wrapper function.
Hope this helps.
Eric
[1] http://jclark.com/xml/xt.html
> Any help would be monsterously appreciated!
>
> Here's a snippit of what I have:
>
> start of my stylesheet ...
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
> xmlns:date="http://www.jclark.com/xt/java/java.util.GregorianCalendar"
> version="1.0">
>
> then later ....
>
> <xsl:template match="ACTUAL-VALUE">
>
> ....
>
> <!-- instantiate my Gregorian Calendar -->
> <xsl:variable name="mygc" select="date:new()"/>
>
> <!-- set the calendar parameters. Just passing in literals for now, will
> write a function later. -->
> <xsl:value-of select="date:set($mygc,2000,0,30)"/>
>
> <!-- get values back out -->
> <xsl:element name="afteryear"><xsl:value-of select="date:get($mygc,
> Calendar.YEAR)"/></xsl:element>
> <xsl:element name="aftermonth"><xsl:value-of select="date:get($mygc,
> Calendar.MONTH)"/></xsl:element>
> <xsl:element name="afterday"><xsl:value-of select="date:get($mygc,
> Calendar.DAY_OF_MONTH)"/></xsl:element>
> ....
>
> Thanks,
>
> Graham
>
> --
> Mailing list for the XT users community. (http://csrclearinghouse.org)
> (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
--
Pour y voir plus clair dans la nebuleuse XML...
http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist http://merchantprocessor.com - http://clarkcountychamber.com
http://merchantprocessor.com - http://comicmediaexpo.com http://wiscrest.org
------------------------------------------------------------------------
--
Mailing list for the XT users community. (http://nymerchantcashadvance.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
Archive générée par hypermail 2b28 le 01/06/2001 - 09:01 CEST
webmaster@4xt.org
|