royale-asjs
royale-asjs copied to clipboard
XML - Implied Attribute Access Not Working In Royale
In Flex
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
width="100%"
height="100%"
creationComplete="init()"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
private function init():void
{
var myXml:XML = <node a="1"/>;
myXml.attribute("a")[0] = "2";
trace(myXml.toXMLString());
}
]]>
</fx:Script>
</mx:Application>
Traces
<node a="2"/>
But in Royale
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
width="100%"
height="100%"
creationComplete="init()"
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:mx="library://ns.apache.org/royale/mx">
<fx:Script>
<![CDATA[
private function init():void
{
var myXml:XML = <node a="1"/>;
myXml.attribute("a")[0] = "2";
trace(myXml.toXMLString());
}
]]>
</fx:Script>
</mx:Application>
Outputs
<node a="1"/>