In short, my question is: how to make a new variable a and give it the same content as an existing object?
Let's say I have the following:
<enum name="floors">
<item name="floor_1" data="mydata" />
<item name="floor_2" data="mydata" />
<item name="floor_3" data="mydata" />
</enum>
So I can do:
Now I wish to make a new variable a which should get the same contents as my first item node above, so that "a" is the equivalent of "enum[floors].item[0]", and I could do things like:
Is there any way to accomplish this? I tried:
This will make a.name available, but not a.data.
Then I tried adding:
but it doesn't help, still no a.data... And if I only do this copy by itself, without the copy above, then even a.name is null...
Can anyone shed some light on this? Thanks!
The reason I'm asking this, is to make it part of a foreach action where one can straight away give the commands one wants to execute on the object's nodes, instead of having to refer to yet another action. But then of course one needs to pass a name for the temporary object one wants to use in the command that needs to be iterated. And that's where the trouble above started...