I'm attempting to convert some AS2 XML code to E4X. I have the following code original XML (now XMLDocument) syntax below:
//temp var used to access createElement and creatTextNode
var tempXML:XML = new XML();
//make an element: <myNodeName>
var myNode:XMLNode = tempXML.createElement("myNodeName");
//make a text node: "myValue"
var myTextNode = tempXML.createTextNode("myValue");
//put the text node into the element: <myNodeName>myValue</myNodeName>
myNode.appendChild( myTextNode );
//test it
trace( myNode.toString() );
What would the equivalent be if I were to write it in E4X?
I'm specifically looking to reproduce the createElement()
and createTextNode()
functions in E4X.