Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
naalco72
Visitor

How to call a function located In an XML file

Hi i have XML file that do have number of items
each item have number of identifications like


<Category>
<item
type="English"
FUNCTION_TO_Call = "English()">
</item>
</Category>


as you can see that there is a text called English() defined in attribute Function_to_call

i was able tom get the text from XML file into my code using parsing method

but i don't fined any solution to instruct the program executor to call the function English() and run it

i use the following code


abc=kid.Function_to_call
abc()



it says that there is no reference available in abc()
but if i use


print kid.Function_to_call


i get what was saved in that attribute in XML file i get English() which is what i want to call for execution

is there any other method to do that
0 Kudos
2 REPLIES 2
GPF
Visitor

Re: How to call a function located In an XML file

you might be able to do something like eval(kid.Function_to_call) to call the function.
0 Kudos
naalco72
Visitor

Re: How to call a function located In an XML file

Hi GPF thanks it was very helpful answer it worked perfectly
thanks again
0 Kudos