The cookbook says:
var fruits:XML = <fruits>
<fruit color="red">
<name>Apple</name>
</fruit>
<fruit color="orange">
<name>Orange</name>
</fruit>
<fruit color="green">
<name>Pear</name>
</fruit>
<fruit color="red">
<name>Watermelon</name>
</fruit>
</fruits>;
// Displays: red
trace( fruits.fruit.(name == "Apple")[EMAIL PROTECTED] );
--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> This should be really easy, but I am struggling. I need to return a
> node based on the value of its text node. Below is the code I am using.
>
> TIA,
> Tracy
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="vertical"
> creationComplete="initApp()">
> <mx:Script><![CDATA[
> private function initApp(): void {
> var xmlNode:XML;
> var myXML:XML =
> <order>
> <item id='1'>
> burger
> </item>
> <item id='2'>
> fries
> </item>
> </order>
> trace([EMAIL PROTECTED]); // WORKS, Output: 1
> trace(myXML.(item=="burger")[EMAIL PROTECTED]); // NOT work want:
> 1************
> Problem line *************
> }//
> ]]></mx:Script>
> </mx:Application>
>