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: 
EnTerr
Roku Guru

RSG: Buggy <field value="..."/> parser

"So you think you know Roku xmlography?"
Here is a challenge - try to guess which of the following will work and which will cause an error, you will be surprised: 
<interface>
 <field id="a" type="assocarray" value = ""/>
 <field id="b" type="assocarray" value="invalid"/> -->
 <field id="c" type="assocarray" value ='{ }'/>
 <field id="d" type="assocarray" value='{a: 2}'/> -->
 <field id="e" type="assocarray" value='{a :"7"} '/> -->
 <field id="f" type="assocarray" value='{" ":7}'/> -->
 <field id="g" type="assocarray" value='{ a: [ 1]}'/>
 <field id="h" type="assocarray" value=' {a: {b:"0" } } '/>
</interface>

Explanation: the "value" attribute evaluator apparently is very fickle. It's neither parseJSON() nor the B/S eval(), it's... something else. Something half-whipped, half-baked. All of the above should be working. Four out of eight don't.

[spoiler=answers:1axij624]
Error creating XML component:
-- Cannot convert initial value string "invalid" to field type assocarray for interface field "b"
...
-- Cannot convert initial value string "{a: 2}" to field type assocarray for interface field "d"
...
-- Cannot convert initial value string "{a :"7"} " to field type assocarray for interface field "e"
...
-- Cannot convert initial value string "{" ":7}" to field type assocarray for interface field "f"
[/spoiler:1axij624]
0 Kudos
3 REPLIES 3
EnTerr
Roku Guru

Re: RSG: Buggy <field value="..."/> parser

@Roku - can i haz bug filed on this one, please?
0 Kudos
EnTerr
Roku Guru

Re: RSG: Buggy <field value="..."/> parser

bump 
0 Kudos
adrianc1982
Visitor

Re: RSG: Buggy <field value="..."/> parser

i hope something gets done for roassociative arrays in RSG

Also please add multidimensional roassociative arrays!!
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.