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: 29/05/2001 - 19:19
Graham Stephenson wrote:
>
> Hi Eric and all,
>
> I've changed my approach a little bit and decided to write a little class
> of my own, as you suggested. I am having trouble calling/instantiating it
> from my stylesheet however. Do I need to give extra commandline arguments to
> tell it where my .class file is?
No, but the class needs to be in your CLASSPATH.
> Also, my syntax is probably wrong. Can you
> take a look?
>
> Here's what I have:
>
> In my stylesheet I give the namespace:
> xmlns:my="http://www.jclark.com/xt/java/com.myself.MyDateUtility"
This will match a MyDateUtility class that is from the package
com.myself.
If you class doesn't belong to any package (by default), you should just
use xmlns:my="http://www.jclark.com/xt/java/MyDateUtility".
Otherwise, this ***looks*** fine.
Hope this helps.
Eric
>
> Then later I try to instantiate it with the following, but it dies on this
> line and says "overloaded constructor":
> <xsl:variable name="myutil" select="my:new()"/>
>
> And then I want to say (but I haven't got this far yet):
> <xsl:value-of select="my:getWeekNumber($myutil,
> number($year),number($month),number($day), 1)"/> (using number() so that an
> xpath number is passed instead of a node-set)
>
> My .class file is in the same directory and the source code is:
> import java.util.Calendar;
> import java.util.GregorianCalendar;
>
> public class MyDateUtility {
>
> public MyDateUtility() { }
>
> public int getWeekNumber(double year, double month, double day, double
> firstDayOfWeek) {
>
> GregorianCalendar mygc = new GregorianCalendar((int)year, (int)month,
> (int)day);
>
> mygc.setFirstDayOfWeek((int)firstDayOfWeek);
> return (mygc.get(Calendar.WEEK_OF_YEAR));
> }
> static void main(String args[]) { }
> }
>
> What's going wrong?
> Thanks,
> Graham
>
> -----Original Message-----
> From: Eric van der Vlist [mailto:vdv@dyomedea.com]
> Sent: Monday, May 28, 2001 4:24 PM
> To: list4xt@4xt.org
> Subject: [list4xt] Re: illegal arguments error?
>
> I am confused by what you are asking ;=) ...
>
> I don't see the set method in the GregorianCalendar of my JDK 1.3.
>
> Furthermore, if you solved this first issue,
> <xsl:value-of select="date:get($mygc, Calendar.YEAR)"/>
> wouldn't mean what you attempt to express (Calendar.YEAR will be
> interpreted as a XPath expression and mean the child elements named
> "Calendar.YEAR") and XT doesn't provide any mean to access to
> properties.
>
> When you need to access standard Java classes, most of the time it is
> much easier to write a wrapper class that will present the datatypes
> that XT is expecting.
>
> Hope this helps.
>
> Eric
>
> Graham Stephenson wrote:
> >
> > Eric,
> >
> > Thanks for the response. However, when I try to declare a Double object
> > like this:
> >
> > <xsl:variable name="yearInteger" select="d:new(d:Double($year))"/> where
> > year is a string, it dies and says "Double: no method with 1 arguments",
> > which is clearly not true according to the java docs. Also tried just
> > passing in 2000 and got the same error. I haven't tried to do anything
> with
> > it yet, just instantiate it.
> >
> > (I also added the namespace
> > xmlns:d="http://www.jclark.com/xt/java/java.lang.Double" )
> >
> > Any ideas?
> >
> > Graham
> >
> > --
> > Mailing list for the XT users community. (http://creditcardprocessors.net)
> > (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://merchantaccountforums.com - http://highriskmerchantcashadvance.com
> http://merchantprocessor.com - http://collectionagencymerchantaccount.com http://osnovafcu.com
> ------------------------------------------------------------------------
>
> --
> Mailing list for the XT users community. (http://newjerseymortgagebrokers.com)
> (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://merchantaccount.cc - http://firstbankcardprocessing.com
http://merchantservicereviews.com - http://newjerseymortgagebrokers.com http://leadinglinksdirectory.com
------------------------------------------------------------------------
--
Mailing list for the XT users community. (http://healthcarequalitymatters.org)
(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
|