I think you'll have to loop. But don't build up an Array... you'd have
to search the Array every time to determine whether that value has
already been added. You should use an Object or Dictionary as a set.

 

Gordon Smith

Adobe Flex SDK Team

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sdl1326
Sent: Thursday, August 21, 2008 7:06 AM
To: [email protected]
Subject: [flexcoders] XML Data - getting unique attributes

 

Hello All, 

I need to grab all unique attribute values in some xml data. Is there a
quick and dirty way to do this? I could push to an array if the value
doesn't already exist, however I did not know if there was a more
efficient way to get these values.
Example:
<data>

        <projects name="Project A" />
        <projects name="Project B" />
        <projects name="Project C" />
        <projects name="Project A" />

</data>

Unique values would be: Project A, Project B, Project C

Thanks for any and all replies.

 

Reply via email to