On Sun, Jan 10, 2016 at 4:53 PM, Harbs <harbs.li...@gmail.com> wrote:

> I’m trying to figure out namespace behavior.
>
> I’m probably tired, but can someone tell me why the  “catalog_item” var in
> this test (on line 70) does not get any results?
>
> https://gist.github.com/Harbs/c24285b3af80eeed251d
>


I put your code in an .as file instead of an .mxml, and it won't compile
because of this line:

var catalog_item = xml..fx::catalog_item[0];
1120: Access of undefined property fx.

I think it's only a warning in MXML ("*possibly* undefined property")
because you've defined the fx namespace in the mxml tag at the top of the
file. To fix it, you either need to add the following to your code inside
CDATA:

namespace fx = 'http://ns.adobe.com/mxml/2009';

or use one of these forms:

var catalog_item = xml..('http://ns.adobe.com/mxml/2009')::catalog_item[0];
var catalog_item = xml.descendants(new QName('http://ns.adobe.com/mxml/2009',
'catalog_item'))[0];

Reply via email to