Hey Everyone,
I have built a XML decoder that places any supplied XML data into a object and spits it back to the callee.
Everything is working so fine, the XML is being parsed, data going into its proper locations… however, when the script does its return, nothing is passed… just a object with no contents…
heres the script, can anyone see whats wrong with it?
function getXML ( tXMLData ) : Object
{
// init Counters
var i : Number = 0
var tData : Object = new Object()
while (tXMLData.childNodes* != null)
{
// Get the Data from the node
//
tData[tXMLData.childNodes*.nodeName] = tXMLData.childNodes*.childNodes[0].nodeValue
// Decode any Attributes within the Node
//
for ( var attri in tXMLData.childNodes*.attributes)
{
tData[attri] = tXMLData.childNodes*.attributes[attri]
}
// Check for Children
//
if (tXMLData.childNodes*.childNodes[0].nodeName != null)
{
tData[“sub”] = getXML ( tXMLData.childNodes* )
}
i++
}
return tData;
}
Thanks in advance for your help !!!