XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
davide galloSubject: Stylus Studio Crashes with Java Extension
Author: davide gallo
Date: 06 Oct 2004 08:18 AM
Hi,
I have some problems with Java Extensions for XQuery:

i'm trying to create a simple xquery procedure that uses a java extension as showed in the example "InitDate",
so at first i wrote a simple java class called "Prova"
with a NON-STATIC method getNext() that returns a constant string "Ciao".
After that i wrote the xquery procedure with an external function who calls the java extension function prova:getNext()....
...each time i call the procedure Stylus Studio crashes without significant error message.. :-(

I have a lot of questions :

1) How do the xquery engine manages call to non static methods ? Where are created the instances of the java extension class ?
2) Is there a differences between these ways to declare the nemespace of the java extension ?
a. declare namespace prova = "java:Prova" ; (this give the error : Java class not found ! ")
b. declare namespace prova = "class:Prova" ; (crash !)
c. declare namespace prova = "Prova" ; (crash !)
than i declare the externa function :

[declare function prova:getNext() as xs:string external;]


I have read the Saxon 8.3 documentation of Michael Kay : he says that the use of java extensions is
[declare namespace prova="java:prova"] without the need of creating an external function !
Than he says that to call non-static methods you have to pass to the funcion called , a call to a predefine function new() :
[prova:getNext(prova:new()) ; ]

Finally the problem is not the non-static method becasue it crash with static methods , or you have the error message : java class implementing ezternal function nont found , and obviously i have checked my classpath ...

Can someone help ?? There are also other questions...

Thank you.

Davide Gallo

Postnext
(Deleted User) Subject: Re: Stylus Studio Crashes with Java Extension
Author: (Deleted User)
Date: 06 Oct 2004 11:24 AM
Hi Davide,

At 08.21 06/10/2004 -0400, stylus-studio-xquery Listmanager wrote:
>Hi,
> I have some problems with Java Extensions for XQuery:
>
>i'm trying to create a simple xquery procedure that uses a java extension
>as showed in the example "InitDate",
>so at first i wrote a simple java class called "Prova"
>with a NON-STATIC method getNext() that returns a constant string "Ciao".
>After that i wrote the xquery procedure with an external function who
>calls the java extension function prova:getNext()....
>...each time i call the procedure Stylus Studio crashes without
>significant error message.. :-(

You have hit a bug in our code :-(
It is caused by the fact that the method has no arguments: the fix for this
bug will be available in the next update of Stylus. In the meanwhile, you
can workaround it by adding a dummy argument.


>I have a lot of questions :
>
>1) How do the xquery engine manages call to non static methods ? Where are
>created the instances of the java extension class ?

When a non-static method is invoked, a temporary object is created using
the default constructor

>2) Is there a differences between these ways to declare the nemespace of
>the java extension ?
>a. declare namespace prova = "java:Prova" ; (this give the error : Java
>class not found ! ")
>b. declare namespace prova = "class:Prova" ; (crash !)
>c. declare namespace prova = "Prova" ; (crash !)
>than i declare the externa function :
>
>[declare function prova:getNext() as xs:string external;]

We only recognize the format "class:Prova" and "Prova".


>I have read the Saxon 8.3 documentation of Michael Kay : he says that the
>use of java extensions is
> [declare namespace prova="java:prova"] without the need of creating an
> external function !
> Than he says that to call non-static methods you have to pass to the
> funcion called , a call to a predefine function new() :
> [prova:getNext(prova:new()) ; ]

Unfortunately there is no official word from the XQuery spec, and every
vendor will adopt different strategies (e.g. the need for the external
function declaration, the addition of a Java object type to the type
system). For the moment we have just replicated the functionality that was
available in the XSLT processor, waiting for the JCP 225 (the writer of the
XQJ interfaces for Java-based XQuery processors) to say a word on the argument.


>Finally the problem is not the non-static method becasue it crash with
>static methods , or you have the error message : java class implementing
>ezternal function nont found , and obviously i have checked my classpath ...
>
>Can someone help ?? There are also other questions...

I hope this helps; and please, go ahead with the other questions!

Alberto


Postnext
davide galloSubject: Re: Stylus Studio Crashes with Java Extension
Author: davide gallo
Date: 06 Oct 2004 02:15 PM
Hi ,Alberto ! Thank you very much for your quick feedback !
I'll adopt your solution in the mean time.

I'm developing with XQuery from last year and i saw your software and Michael Kay's growing up...
Usually i develop directly in java with Kay's Saxon API, but your software is a must for writing
and testing pure Xquery procedures,and for more other things involving XML (validation, xslt transformations, visual mmodeling).

Some other questions and notes:

Will you improve the mapper for Xquery with the same power than the mapper for XSLT ? e.g. java extension functions are not present in the XQuery mapper menu

The Xquery syntax highlighter has some difficulties, expecially with parentesis...

When the XQuery parser catch an error , the messages are a little poor, in same case there isn't the number of the line with an error,
but on the other hand , the debugger is wonderful !

In more exact words : wath is the real link between stylus studio and tha saxon api ?

Will you extend the DB connection to ODBC ?

Finally i think your software is a milestone in XML, and i hope it will grow more.

A last question ...are you Italian ?

Thank you again , see you.

Davide Gallo

Postnext
(Deleted User) Subject: Re: Stylus Studio Crashes with Java Extension
Author: (Deleted User)
Date: 06 Oct 2004 02:46 PM
Hi Davide,

At 14.18 06/10/2004 -0400, stylus-studio-xquery Listmanager wrote:
>Some other questions and notes:
>
>Will you improve the mapper for Xquery with the same power than the mapper
>for XSLT ? e.g. java extension functions are not present in the
>XQuery mapper menu

That's probably just a GUI problem; they should be already available to the
engine.


>The Xquery syntax highlighter has some difficulties, expecially with
>parentesis...

Do you refer to the fact that keywords like "element {}" have the
parenthesis in two different colors? This is caused by the fact that the
left brace has to be part of the same token with "element", while the right
brace is on its own. Or have you seen something different?


>When the XQuery parser catch an error , the messages are a little poor, in
>same case there isn't the number of the line with an error,
>but on the other hand , the debugger is wonderful !

Sometimes it depends on where the error is detected; but if you have
specific cases we are always willing to improve on our product.


>In more exact words : wath is the real link between stylus studio and tha
>saxon api ?
>
>Will you extend the DB connection to ODBC ?

I don't understand what you mean by "link". Can you elaborate?


>Finally i think your software is a milestone in XML, and i hope it will
>grow more.
>
>A last question ...are you Italian ?

Yes ;-)

Ciao,
Alberto


Postnext
davide galloSubject: Re: Stylus Studio Crashes with Java Extension
Author: davide gallo
Date: 06 Oct 2004 03:09 PM
Hi ,Alberto

the DB to XML tool actually support only the most famous DBs , it is possible that in future it will support generic ODBC connections?


The rapport(connection) between stylus studio and the actual release of the Saxon api ? Is the built-in Xquery / XSLT engine of Stylus Studio based on Saxon ?

Ciao e grazie per i chiarimenti.

Davide

Posttop
Ivan PedruzziSubject: Re: Stylus Studio Crashes with Java Extension
Author: Ivan Pedruzzi
Date: 06 Oct 2004 03:48 PM
>Hi ,Alberto
>
>the DB to XML tool actually
>support only the most famous
>DBs , it is possible that in
>future it will support generic
>ODBC connections?
>

Ciao Davide

With a bit more work you can use any ODBC data source.
Take a look to Sequelink tutorial
http://www.stylusstudio.com/configure_data_source.html


>The rapport(connection)
>between stylus studio and the
>actual release of the Saxon
>api ? Is the built-in Xquery /
>XSLT engine of Stylus Studio
>based on Saxon ?

Saxonica (http://www.saxonica.com/) and the Stylus Studio team are technology partners.
Our team is committed to build the best XQuery developer tool for Saxon.

We strongly encourage our users to download Saxon and try.
It is extraordinary peace of technology that delivers: XSLT 1, XSLT 2, XQuery and XML Schema validation in one package.

Our built-in XQuery processor is a different implementation (C++ based).
There are very interesting activities/partnerships around it, you will hear soon

Ivan Pedruzzi
Stylus Studio Team

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.