Im new to flex and I am trying to create an xml document in code. Here is a snippet of my code:
fuelNode = xmlDoc.createElement("Fuel");
childNode = xmlDoc.createElement("FuelID");
childNode.nodeType = 1;
childNode.nodeValue = inArray[i].FuelID;
This creates the following xml :
as you can see there is no value for FuelID.
if I change the childNode.nodeType to 3 I get the following :
What I am trying to create is :
Any help would be really appreciated. Thanks
I would use XML, not XMLDocument and insert a text node.
Thanks for your reply, can you give me some example code on how I use the XML object. eg setting up the declaration, root node etc. Thanks
There are several ways.
You can literally build up a string and convert it.
var fuelString:String =