This is not a direct answer to your immediate question , but rather a
general tip:

If you need complex calculations within an e4x expression, you can call
out to a function of your own.  The () just requires a boolean value, so
you can do something like below, where I wanted to a bit of string
manipulation within the expression:

xlFilteredItems =
_xmlData..item.(itemContains(attribute("item"),sFilterString))

 

and the function:

  private function itemContains(sItem:String, sMatch:String):Boolean

  {

    sItem = sItem.toLowerCase();

    sMatch = sMatch.toLowerCase();

    return (sItem.indexOf(sMatch) != -1);

  }//contains

 

Tracy

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Carter
Sent: Monday, September 22, 2008 11:59 AM
To: [email protected]
Subject: Re: [flexcoders] e4x problem - filtering elements based on
multiple child conditions

 


It seems to work it out for you when it can.

name.text()[0].toLowerCase() works
name.text().toLowerCase() also works if there is exactly one name child
of
each group element.

Daniel Freiman wrote:
> 
> name.text()[0] will give you a single XML node of Kind string. If you
> want
> to operate on it as a string simply do: name.text()[0].toString()
> 

-- 
View this message in context:
http://www.nabble.com/e4x-problem---filtering-elements-based-on-multiple
-child-conditions-tp19604364p19611043.html
<http://www.nabble.com/e4x-problem---filtering-elements-based-on-multipl
e-child-conditions-tp19604364p19611043.html> 
Sent from the FlexCoders mailing list archive at Nabble.com.

 

Reply via email to