I've not got the code anymore as I'm doing it a different way but I tried
something like this:
var attributesToCopy:XML = new XML (<nodeName attr1="var1" attr2="var2" />);
var copyTarget:Xml = new XML ("<nodeName />");
for (attributeName in attributesToCopy.attributes())
{
[EMAIL PROTECTED] = [EMAIL PROTECTED];
}
for a start the attributes() array that is returned only seems to hold the
attribute values not the names. I also don't think the [EMAIL PROTECTED]
works.
On 10/25/07, Alex Harui <[EMAIL PROTECTED]> wrote:
>
> What does your code look like?
>
>
> ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Giles Roadnight
> *Sent:* Thursday, October 25, 2007 4:21 AM
> *To:* [email protected]
> *Subject:* [flexcoders] Copying xml node attributes
>
>
>
> What's the easiest way to copy a load of attributes from one XML node
> to another?
>
> I tried looping over the attributes() array but that didn't seem to work.
>
> Thanks
>
>
>
--
Giles Roadnight
http://giles.roadnight.name