Hi everybody!
I was following the XML tutorial on: http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg7.htm and was wondering about this strange thingie…
the xml looks like this:
<Books>
<Book ISBN=“0553212419”>
<title>Sherlock Holmes: Complete Novels and Stories, Vol 1</title>
<author>Sir Arthur Conan Doyle</author>
</Book>
<Book ISBN=“0743273567”>
<title>The Great Gatsby</title>
<author>F. Scott Fitzgerald</author>
</Book>
<Book ISBN=“0684826976”>
<title>Undaunted Courage</title>
<author>Stephen E. Ambrose</author>
</Book>
<Book ISBN=“0743203178”>
<title>Nothing Like It In the World</title>
<author>Stephen E. Ambrose</author>
</Book>
</Books>
The code like this:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest(“blabla.xml”));
function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
ParseInfo(xmlData);
}
function ParseInfo(xmlInput:XML):void {
trace(“XML Output”);
trace("------------------------");
// the following search traces:
// Undaunted Courage
var xmlList:XMLList = xmlInput.Book.(author == “Stephen E. Ambrose” && title != “Nothing Like It In the World”).title;
// the following search traces:
//<title>Undaunted Courage</title>
//<title>Nothing Like It In the World</title>
var xmlList:XMLList = xmlInput.Book.(author == "Stephen E. Ambrose").title;
trace(xmlList);
}
Now why is it that if I use the second xmlList, the trace is with XML-tags? If I use the first one, the result comes back without?