You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Tobias McNulty <tm...@datadesk.com> on 2002/03/26 17:34:16 UTC

SQL Extension

Is anyone out there using the SQL Extension for Xalan?  I am having 
trouble setting up the XSL to bind to Java objects, and the example 
doesn't seem to function (I converted it to use the MySQL driver). 
Does anyone have a working example that I could try?

In my experience, the example XSL usually generates obscure 
NullPointerExceptions or TransformerExceptions during the 
transformation.

Thanks,
Toby
-- 
Tobias McNulty
Data Description, Inc.
840 Hanshaw Road, Suite 9
Ithaca, NY 14850
Phone: (607) 257-1000
E-mail: tmcnulty@datadesk.com
Web: www.datadesk.com

RE: SQL Extension

Posted by Tobias McNulty <tm...@datadesk.com>.
Gary,

I fixed that problem by changing my XSL to look something like:

<xsl:stylesheet ... xmlns:bt="com.foo" extension-element-prefixes="bt">

<xsl:variable name="avar" select="bt:BindTest.new()"/>
<xsl:value-of select="bt:BindTest.myFunc($avar)"/>

The Java binding seems to be very picky.  I couldn't get the above 
method to work for certain members of the SQL Extension family.  In 
order to access XConnection.query, I had to subclass XConnection and 
make query a static method that took an instance variable as an 
argument (I _thought_ Java binding was supposed to do this for you 
automatically, but it doesn't seem to do so in all cases).

So I'll ask my original question again: what is the status of the SQL 
Extension and/or Java/XSL language binding?  Are people using it, or 
is it still in the early stages of development?

Much thanks,
Toby

>Toby --
>
>Can't help with the sql:new() at the moment.  But, what does your stack
>trace look like from the "Instance method call to method new requires an
>Object instance as first argument" message?
>
>Gary
>
>>  -----Original Message-----
>>  From: Tobias McNulty [mailto:tmcnulty@datadesk.com]
>>  Sent: Tuesday, March 26, 2002 9:46 AM
>>  To: xalan-j-users@xml.apache.org
>>  Subject: Re: SQL Extension
>>
>>
>>  >Is anyone out there using the SQL Extension for Xalan?  I am having
>>  >trouble setting up the XSL to bind to Java objects, and the example
>>  >doesn't seem to function (I converted it to use the MySQL driver).
>>  >Does anyone have a working example that I could try?
>>  >
>>  >In my experience, the example XSL usually generates obscure
>>  >NullPointerExceptions or TransformerExceptions during the
>>  >transformation.
>>  >
>>  >Thanks,
>>  >Toby
>>
>>  It appears that sql:new(...) is returning null (which I assume is
>>  because it can't find the driver).  The driver has already been
>>  (successfully) loaded in pure Java code using the raw JDBC functions.
>>  Any idea what's going on here?
>>
>>
>>  I am also having some trouble calling instance level methods from
>>  XSL.  I create a new variable like so:
>>
>  > <xsl:variable name="avar" select="bt:new()"/>
>>  <xsl:value-of select="bt:myFunc($avar)"/>
>>
>>  Where myfunc is an instance-level function of the class referenced by
>>  the bt: namespace:
>>
>>  <xsl:stylesheet ... xmlns:bt="java:com.foo.BindTest"
>  > extension-element-prefixes="bt">
>>
>>  Xalan gives me the following error:
>>
>>  "Instance method call to method new requires an Object instance as
>>  first argument"
>>
>>  This would lead me to believe that it's trying to call new() as an
>>  instance level method, when it is (I _believe_) a static method (or
>>  "pseudo" method, in this case).  Do I have to define anything on the
>>  Java side to support the method new()?
>>
>>  Thanks,
>>  Toby
>>
>>  --
>>  Tobias McNulty
>>  Data Description, Inc.
>>  840 Hanshaw Road, Suite 9
>>  Ithaca, NY 14850
>  > Phone: (607) 257-1000
>  > E-mail: tmcnulty@datadesk.com
>  > Web: www.datadesk.com
>  >


-- 
Tobias McNulty
Data Description, Inc.
840 Hanshaw Road, Suite 9
Ithaca, NY 14850
Phone: (607) 257-1000
E-mail: tmcnulty@datadesk.com
Web: www.datadesk.com

RE: SQL Extension

Posted by Gary L Peskin <ga...@firstech.com>.
Toby --

Can't help with the sql:new() at the moment.  But, what does your stack
trace look like from the "Instance method call to method new requires an
Object instance as first argument" message?

Gary

> -----Original Message-----
> From: Tobias McNulty [mailto:tmcnulty@datadesk.com] 
> Sent: Tuesday, March 26, 2002 9:46 AM
> To: xalan-j-users@xml.apache.org
> Subject: Re: SQL Extension
> 
> 
> >Is anyone out there using the SQL Extension for Xalan?  I am having
> >trouble setting up the XSL to bind to Java objects, and the example 
> >doesn't seem to function (I converted it to use the MySQL driver). 
> >Does anyone have a working example that I could try?
> >
> >In my experience, the example XSL usually generates obscure
> >NullPointerExceptions or TransformerExceptions during the 
> >transformation.
> >
> >Thanks,
> >Toby
> 
> It appears that sql:new(...) is returning null (which I assume is 
> because it can't find the driver).  The driver has already been 
> (successfully) loaded in pure Java code using the raw JDBC functions. 
> Any idea what's going on here?
> 
> 
> I am also having some trouble calling instance level methods from 
> XSL.  I create a new variable like so:
> 
> <xsl:variable name="avar" select="bt:new()"/>
> <xsl:value-of select="bt:myFunc($avar)"/>
> 
> Where myfunc is an instance-level function of the class referenced by 
> the bt: namespace:
> 
> <xsl:stylesheet ... xmlns:bt="java:com.foo.BindTest" 
> extension-element-prefixes="bt">
> 
> Xalan gives me the following error:
> 
> "Instance method call to method new requires an Object instance as 
> first argument"
> 
> This would lead me to believe that it's trying to call new() as an 
> instance level method, when it is (I _believe_) a static method (or 
> "pseudo" method, in this case).  Do I have to define anything on the 
> Java side to support the method new()?
> 
> Thanks,
> Toby
> 
> -- 
> Tobias McNulty
> Data Description, Inc.
> 840 Hanshaw Road, Suite 9
> Ithaca, NY 14850
> Phone: (607) 257-1000
> E-mail: tmcnulty@datadesk.com
> Web: www.datadesk.com
> 


Re: SQL Extension

Posted by Tobias McNulty <tm...@datadesk.com>.
>Is anyone out there using the SQL Extension for Xalan?  I am having 
>trouble setting up the XSL to bind to Java objects, and the example 
>doesn't seem to function (I converted it to use the MySQL driver). 
>Does anyone have a working example that I could try?
>
>In my experience, the example XSL usually generates obscure 
>NullPointerExceptions or TransformerExceptions during the 
>transformation.
>
>Thanks,
>Toby

It appears that sql:new(...) is returning null (which I assume is 
because it can't find the driver).  The driver has already been 
(successfully) loaded in pure Java code using the raw JDBC functions. 
Any idea what's going on here?


I am also having some trouble calling instance level methods from 
XSL.  I create a new variable like so:

<xsl:variable name="avar" select="bt:new()"/>
<xsl:value-of select="bt:myFunc($avar)"/>

Where myfunc is an instance-level function of the class referenced by 
the bt: namespace:

<xsl:stylesheet ... xmlns:bt="java:com.foo.BindTest" 
extension-element-prefixes="bt">

Xalan gives me the following error:

"Instance method call to method new requires an Object instance as 
first argument"

This would lead me to believe that it's trying to call new() as an 
instance level method, when it is (I _believe_) a static method (or 
"pseudo" method, in this case).  Do I have to define anything on the 
Java side to support the method new()?

Thanks,
Toby

-- 
Tobias McNulty
Data Description, Inc.
840 Hanshaw Road, Suite 9
Ithaca, NY 14850
Phone: (607) 257-1000
E-mail: tmcnulty@datadesk.com
Web: www.datadesk.com