Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
EnTerr
Level 8

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
EnTerr
Level 8

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

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

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

bump 
0 Kudos
adrianc1982
Level 7

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

i hope something gets done for roassociative arrays in RSG

Also please add multidimensional roassociative arrays!!
0 Kudos