Hi Tom,

I don't want a list of countries, I want the entire node if it contains a
particular country value (the node may contain multiple county values)

Eg of XML (if the user searches for any of the three countries this node
should be returned):

<node>
   <label>AAA</label>
   <country>Peru</country>
   <country>Kenya</country>
   <country>Istanbul</country>
</node>

I was hoping there would be an easier way, but not being too familiar with
e4x, I settled for getting the job done by looping through the nodes,
pulling out an xmllist of countries for each node, and if a country matches,
popping the entire node in another array.

However, back to the original post, when I say
                  for each(var theNode:XML in myTestData..node)
I wasn't expecting that line of code to alter the value of myTestData too.

Do you have a moment to copy/paste and test the code I posted?
Cheers



On 10/23/07, Tom Chiverton <[EMAIL PROTECTED]> wrote:
>
> On Tuesday 23 Oct 2007, [EMAIL PROTECTED] wrote:
> >  var keywords:XMLList = theNode.country;
> > var numMatches:uint =
> > keywords.(text()==countryString).length();
>
> Why do you do this and not
> nodesMatch=myTestData.node.country.(text()==countryString)
> (or similar, not tested that)
> --
> Tom Chiverton. Are you a great Flex programmer, who knows Cairngorm, and
> has
> done some ColdFusion work ? Would you like to work for a top 30 law firm
> in
> Manchester, UK ? Are not an agency ? If yes, send email !
>
> ****************************************************
>
> This email is sent for and on behalf of Halliwells LLP.
>
> Halliwells LLP is a limited liability partnership registered in England
> and Wales under registered number OC307980 whose registered office address
> is at St James's Court Brown Street Manchester M2 2JF.  A list of members is
> available for inspection at the registered office.  Any reference to a
> partner in relation to Halliwells LLP means a member of Halliwells
> LLP.  Regulated by The Solicitors Regulation Authority.
>
> CONFIDENTIALITY
>
> This email is intended only for the use of the addressee named above and
> may be confidential or legally privileged.  If you are not the addressee you
> must not read it and must not use any information contained in nor copy it
> nor inform any person other than Halliwells LLP or the addressee of its
> existence or contents.  If you have received this email in error please
> delete it and notify Halliwells LLP IT Department on 0870 365 8008.
>
> For more information about Halliwells LLP visit www.halliwells.com.
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>

Reply via email to