I have a string in XML format and I want to use this string as flex XML type as following :
This is my string :
<Graph>
<Node id="1" name="1" nodeColor="0x333333" nodeIcon="center" x="10" y="10" />
<Node id="2" name="2" nodeColor="0x333333" nodeIcon="center" x="10" y="10" />
<Node id="3" name="3" nodeColor="0x333333" nodeIcon="center" x="10" y="10" />
</Graph>
I cant pass this to an API, it complains that this is string and it expects an XML type. How can i convert this string to XML with minimum effort, ie: without iterating the string and the nodes etc. Is there such method as : var data:XML = new XML(str:String);
How can i solve this?
This blog entry suggests that the following would work:
var sText:String = "<your-xml-here />";
var xData:XML = XML(sText);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With