Hi,
You don't need the quotes when assigning it to an attribute, myXml:XML =
<Option value={myString}></option> should do the trick.
scott_flex wrote:
>
> how come the following does not work
>
> var myString:String = "Test data";
> var myXml:XML = <Option value="{myString}"></option>
> //not string substituion occurs, "{myString}" is just inserted as a
> literal.
>
> but this does:
>
> var myString:String = "Test data";
> var myXml:XML = <Option>{myString}</option>
> // {myString} is property repaced wiht the text "Test data"... as I
> would expect.
>
> For some reason i can't bind or use the {} notation when creating an
> XML object and trying to assign attributes of an element... but it
> does work when i use the {} notation to insert text between the begin
> and end tags of a node.
>
> Am i doing something wrong? Or is this a limitation.... seems silly
> if it is.
>
>