Why I always get "null" returned when calling functions?
Francisco <jshzhang2000-/[email protected]> Mon, 26 Feb 2007 16:16:18 +0000 (GMT)
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
--===============0960840683==
Content-Type: multipart/alternative; boundary="0-1806004993-1172506578=:22184"
Content-Transfer-Encoding: 7bit
--0-1806004993-1172506578=:22184
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Dear Martin,
=20
Sorry to bother you again. I have the difficulty in following your exam=
ple to call the functions. The problem is mainly on this line -----=20
=20
Function func =3D program.getResolver().getFunction(functionName,signat=
ure);
=20
I always get "null" as return, I don't know how to solve it. I checked =
the API but couldn't find more details on how to pass the arguments or si=
gnatures for designated functions? I tried to put signatures inside. But =
still not succeed. Could you please kindly give a further explaination on=
this? Thank you very much for your help.
=20
Looking forward to your email.
=20
Kind regards,
Francisco
=20
For your convenience, this is the example you provided before:
=20
import org.oXML.type.*;
import org.oXML.engine.*;
...
String systemId =3D "your-file.oml";
Name functionName =3D new Name("your-function");
Type[] signature =3D new Type[]{}; // default sig, ie your-function()
Node[] args =3D new Node[]{}; // empty args
...
ProgramFactory pfactory =3D new ProgramFactory();
pfactory.loadDefaultExtensions();
InterpretedProgram program =3D pfactory.getProgram(systemId);
pfactory.compile(program);
Function func =3D program.getResolver().getFunction(functionName, =20
signature);
RuntimeContext env =3D new RuntimeContext(program);
Node result =3D func.invoke(args, env);
String stringResult =3D result.stringValue();
=20
=20
=20
Martin Klang <[email protected]> wrote:
Hi Francisco,
Apologies, since it appears I provided an example that depends on a=20
version not yet released.
I have now packaged and released a new ObjectBox version that=20
includes the latest changes and the ProgramFactory.
You can find it here:
http://download.pingdynasty.com/o-xml/ObjectBox/ObjectBox-1.1.6/
Pls don't hesitate to ask again should you have any further questions.
Updates on the new features (Spring Framework integration, updated=20
database extensions) will follow shortly.
best regards,
/m
On 23 Feb 2007, at 2:52, Francisco wrote:
> Hi martin,
>
> Sorry to send you couples of emails addressing this issue. I can=20
> see in the web, the API document shows the ProgramFactory is=20
> underneath org.oxml.eng, however, ProgramFactory is not actually=20
> included in the objectbox distribution. We still have to ask for=20
> your kind help to solve this issue. I also hope this is the last=20
> question bothering you :-)
>
> Looking forward to your help.
>
> Kind regards,
> Francisco
>
=09
---------------------------------
To help you stay safe and secure online, we've developed the all new Yah=
oo! Security Centre.
--0-1806004993-1172506578=:22184
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<div>Dear Martin,</div> <div> </div> <div>Sorry to bother you agai=
n. I have the difficulty in following your example to call the =
functions. The problem is mainly on this line ----- </div> <div> </=
div> <div><STRONG>Function func =3D program.getResolver().getFunction(fu=
nctionName,signature);</STRONG></div> <div> </div> <div>I always g=
et "null" as return, I don't know how to solve it. I checked th=
e API but couldn't find more details on how to pass the arguments or sign=
atures for designated functions? I tried to put signatures inside. But st=
ill not succeed. Could you please kindly give a further explaination on t=
his? Thank you very much for your help.</div> <div> </div> <div>Lo=
oking forward to your email.</div> <div> </div> <div>Kind regards,=
<BR>Francisco</div> <div> </div> <div>For your convenience, this i=
s the example you provided before:</div> <div> </div> <div>import =
org.oXML.type.*;<BR>import
org.oXML.engine.*;<BR>...<BR>String systemId =3D "your-file.oml";<BR>Nam=
e functionName =3D new Name("your-function");<BR>Type[] signature =3D new=
Type[]{}; // default sig, ie your-function()<BR>Node[] args =3D new Node=
[]{}; // empty args<BR>...<BR>ProgramFactory pfactory =3D new ProgramFact=
ory();<BR>pfactory.loadDefaultExtensions();<BR>InterpretedProgram program=
=3D pfactory.getProgram(systemId);<BR>pfactory.compile(program);<BR><STR=
ONG>Function func =3D program.getResolver().getFunction(functionName,&nbs=
p; <BR>signature);<BR></STRONG>RuntimeContext env =3D new RuntimeContext(=
program);<BR>Node result =3D func.invoke(args, env);<BR>String stringResu=
lt =3D result.stringValue();</div> <div> </div> <div> </div> =
<div><BR><BR><B><I>Martin Klang <[email protected]></I></B> wrote:<=
/div> <BLOCKQUOTE class=3Dreplbq style=3D"PADDING-LEFT: 5px; MARGIN-LEFT=
: 5px; BORDER-LEFT: #1010ff 2px solid">Hi Francisco,<BR><BR>Apologies, si=
nce it appears I provided an example that depends on a
<BR>version not yet released.<BR><BR>I have now packaged and released a =
new ObjectBox version that <BR>includes the latest changes and the Progra=
mFactory.<BR><BR>You can find it here:<BR>http://download.pingdynasty.com=
/o-xml/ObjectBox/ObjectBox-1.1.6/<BR><BR>Pls don't hesitate to ask again =
should you have any further questions.<BR><BR>Updates on the new features=
(Spring Framework integration, updated <BR>database extensions) will fol=
low shortly.<BR><BR>best regards,<BR><BR>/m<BR><BR><BR>On 23 Feb 2007, at=
2:52, Francisco wrote:<BR><BR>> Hi martin,<BR>><BR>> Sorry to s=
end you couples of emails addressing this issue. I can <BR>> see in th=
e web, the API document shows the ProgramFactory is <BR>> underneath o=
rg.oxml.eng, however, ProgramFactory is not actually <BR>> included in=
the objectbox distribution. We still have to ask for <BR>> your kind =
help to solve this issue. I also hope this is the last <BR>> question =
bothering you :-)<BR>><BR>>
Looking forward to your help.<BR>><BR>> Kind regards,<BR>> Fran=
cisco<BR>><BR><BR></BLOCKQUOTE><BR><p> 
<hr size=3D1>=20
To help you stay safe and secure online, we've developed the all new <a h=
ref=3D"http://us.rd.yahoo.com/mail/uk/taglines/yahoo_co_uk/security_centr=
e/*http://uk.security.yahoo.com/">Yahoo! Security Centre</a>.
--0-1806004993-1172506578=:22184--
--===============0960840683==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
o-xml mailing list
o-xml-zRfLyl9bSvv/[email protected]
http://lists.pingdynasty.com/mailman/listinfo/o-xml
--===============0960840683==--