views:

35

answers:

0

hi, i have a java object called myObject with function foo(Element e) that i am binding to the rhino context. in the script i am creating an XML using E4X, my question is how can i would pass this XML object as a parameter to foo?

there is one solution to work with Strings something like:

var data = new XML();
//Set data using E4X
data.group.Fstr1 = "some data";
data.group.Fstr2 = "some more data";
data.group.Fdate1 = "2010-02-02";

myObject.foo(data.toXMLString());

but it is really not efficient (there is always toXMLString and new XML's) and looks really bad in the script, any ideas?