Many apologies for the subject line, it should have been "E4X descendant
operator doesn't work for XML object?" ... the original subject line related
to just my own coding stupidity.
On 2/28/07, thirtyfivemph <[EMAIL PROTECTED]> wrote:
I've run into a curious problem with E4X (which is otherwise
spectacular). Given this document:
var document:XML =
<document id="1">
<object id="4">
<content id="3">
<node id="20" />
</content>
</object>
<object id="7">
</object>
</document>;
I would have expected this code to work:
var list:XMLList = game..(@id == 7);
But the compiler gives me an error message:
Syntax error: expecting doublecolon before rightparen.
Can I not use the descendant selector ("..") directly on an XML
object? All of the examples I've seen use it on XMLList objects, but I
didn't see any specific mentions that it only works with XMLList
objects. For now, it seems I have to do this to get the result I'm
looking for:
var list:XMLList = game.descendants().(@id == 7);
Which is fine, I just need to make sure I'm not misunderstanding the
E4X syntax or rules.
Thanks,
Troy.