Re: How to write or reconfigure values of variables in o:xml?
Martin Klang <[email protected]> Fri, 16 Mar 2007 11:51:21 +0000
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
Hi Francisco, you could perhaps try returning an object of a user-defined type from the o:XML program, then calling functions on that object from Java. As I don't know the context it's a little bit difficult for me to offer more advice. Maybe you could try to explain how your different Java and o:XML components fit together, and how they are called. best regards, /m On 11 Mar 2007, at 14:59, Francisco wrote: > Dear Martin, > > How have you been recently? Since I got your kind help weeks ago, > I have been working on the project and it seems there is another > problem arise when I come into the setVariableValue() methods which > are defined into the o:xml. > > In the example you provided, the method "plus" just read the values > and sum them together, it is mainly a "read" process, however, we > also need "write" process in the project, which means, the defined > method setVariableValue() should be able to reconfigure the values > of the variables whenever needed. As we know, Java could "read" > and "write" xml files via DOM tree, but I don't know how o:xml > achieve this goal and couldn't find an example of it from all the > currently available documents. I sincerely hope you can help me > out. I appreciate your help very much always. > > Looking forward to hearing from you. > > Kind regards, > Francisco > > > > > > Martin Klang <[email protected]> wrote: > Francisco, > > You need to match the function name and signature, in the same way as > when you call Class.getMethod(String, Class[]) in Java. > > For example, if your function definition looks like this: > > > > > > > > > ie you've defined the function 'plus(Number, Number)', then you can > look up the function like this: > > Function func = program.getResolver().getFunction(new Name("plus"), > new Type[]{NumberNode.TYPE, NumberNode.TYPE}); > > I have put together a couple of working examples that you can > download from here: > http://mars.pingdynasty.com/CallObjectboxExamples.zip > > You need to have the latest objectbox.jar on your classpath to > compile and run the Java program. > > best of luck, I look forward to hearing of your success! > > /m > > > On 26 Feb 2007, at 16:16, Francisco wrote: > > > Dear Martin, > > > > Sorry to bother you again. I have the difficulty in following your > > example to call the functions. The problem is mainly on this line > > ----- > > > > Function func = program.getResolver().getFunction > > (functionName,signature); > > > > 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 signatures 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. > > > > Looking forward to your email. > > > > Kind regards, > > Francisco > > > > > Copy addresses and emails from any email account to Yahoo! Mail - > quick, easy and free. Do it now... > _______________________________________________ > o-xml mailing list > o-xml-zRfLyl9bSvv/[email protected] > http://lists.pingdynasty.com/mailman/listinfo/o-xml