Would the following be the most efficient method for extracting both title and ISBN from the AS3 tutorial example http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm?
xmlLoader.addEventListener (Event.COMPLETE, LoadXML);
xmlLoader.load (new URLRequest("http://www.kirupa.com/net/files/sampleXML.xml"));
//
function LoadXML (e:Event):void
{
xmlData = new XML(e.target.data);
ParseBooks (xmlData);
}
function ParseBooks (bookInput:XML):void
{
trace ("XML Output");
trace ("------------------------");
/*
var authorList:XMLList = bookInput.Book.author;
for each (var authorElement:XML in authorList)
{
trace (authorElement);
}
*/
var bookAttributes:XMLList = bookInput.Book.attributes();
var bookTitle:XMLList = bookInput.Book.title;
for each (var bookISBN:XML in bookAttributes)
{
trace (bookISBN);
}
for each (var titleList:XML in bookTitle)
{
trace (titleList);
}
}