xml descendant traversal
Hi,
When calling the following piece of code, I get two different results from the same descendant path for some reason:
var xmlt:XML =
<xml xmlns="http://blabla">
<animal type="sheep" >
<name>josh</name>
<age>2</age>
</animal>
<animal type="cow" >
<name>jim</name>
<age>2</age>
</animal>
</xml>
var ns:Namespace = new Namespace("http://blabla");
default xml namespace = ns;
trace("first attempt:" + xmlt..name[0]); // results in josh
trace("second attempt" + xmlt..name[0] ); // results in undefined?
Any reason why the two are not the same? I got to this when trying to figure out why some code worked and other parts didn't... beats the hell out of me. (btw: I use a Logger instead of the trace, but don't think it matters here)
Regards