A
Arun
How can i execute a string, for example:
int x = 2;
int y = 4;
int z;
String command = " z = x*y "
For some background on why i want to do this:
I have an element tree.
To add a certain element, i need to use the following command:
element.getChild("bla").setContent(newElement);
Problem is that the number of .getChild() corresponds to the element
depth in the tree.
So if its depth was two, then the command would be:
element.getChild("bla's dad").getChild("bla").setContent(newElement);
I can't do a for loop and then with every iteration get the child from
the previous child, because when i add an element i won't be adding it
to the whole element tree, il just be adding it to the previous
element.
I could build the whole tree again but that seems wasteful.
int x = 2;
int y = 4;
int z;
String command = " z = x*y "
For some background on why i want to do this:
I have an element tree.
To add a certain element, i need to use the following command:
element.getChild("bla").setContent(newElement);
Problem is that the number of .getChild() corresponds to the element
depth in the tree.
So if its depth was two, then the command would be:
element.getChild("bla's dad").getChild("bla").setContent(newElement);
I can't do a for loop and then with every iteration get the child from
the previous child, because when i add an element i won't be adding it
to the whole element tree, il just be adding it to the previous
element.
I could build the whole tree again but that seems wasteful.