views:

72

answers:

1

Possible Duplicate:
In Flash, how would I run an e4x statement when that statement is stored in a String?

I know there is an existing question regarding this problem, but it got no replies.

Ideally, I would like to stick an e4x expression in a string and run it. i.e.

var tempXML:XML = someXML;
var stringe4x:XML = "pictures.picture.(size > 200)";
tempXML.eval(pictures);  //something instead of eval

Since AS3 doesn't have eval, this doesn't work; however, there is the ability to use elements() and attributes() to get the elements or attributes on the same XML node level, but this doesn't work for the more complicated e4x filters such as "(id > 300)" or ".." notation.

Any ideas? Thanks in advance.

A: 

You need to use XPath instead of E4X.

Luke