Question

I'm hacking around in a Firefox extension, trying to use E4X. However, I've come across a weird problem:

var myXml = <test xmlns="http://test.com">
     Hey
     <inner>
        Guys
      </inner>
   </test>;

var ns = myXml.namespace();

default xml namespace = ns;

this.log(myXml.*::inner);
this.log(myXml.ns::inner);
this.log(myXml.inner);

The first two log statements print "Guys". The third is blank. What's going on? I've specified the default namespace, and it's in fact the exact same thingas I'm using in the second log statement. Why doesn't this work?

Mozilla's documentation suggests this should work.

Was it helpful?

Solution

In Firefox 3 your code runs as you expect. Maybe you run into a bug found in older version of Gecko?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top