0

I'm using a descendant accessor like so:

var myxml:XMLList = new XMLList;

...

myxml..node

and would like to replace it w/

const sNode:String = 'node';
myxml..[{sNode}]

This sort of thing has worked before.

const sAttrib:String = 'attrib';
myxml.@[{sAttrib}]

works, but trying the same sort of thing w/a descendant accessor causes a compiler error.

Yes, I could do

myxml.descendants(sNode)

but I'd rather do it w/operators, if I can.

The XML might be something like:

<map>
    <node>
       <node />
    </node>
</map>
Opux
  • 702
  • 1
  • 10
  • 30
  • Why the preference for operators? Please post an example of the XML file. – null Sep 11 '15 at 14:46
  • @null Because the strings I'm using are constants. I'm just of the mind that strictly using E4X w/string constants will be optimal, instead of including functions. At least, that's what an average optimizer would do. XML included. – Opux Sep 11 '15 at 14:58

0 Answers0