> If you think he wants to do "sorting" as you described it, why don't you
> post some code that does that instead of arguing about the code sample I
> posted trying to help him accomplish what I think he wants to do?
Hehe, that shut him up, Jason. :)
You can do something like:
var xml:XML =
;
var a:Array = new Array();
for each(var item:XML in xml.node){
a.push(item);
}
a.sortOn(["@ccc"]);
var newxmllist:XMLList = new XMLList();
for(var i:uint = 0, len:uint = a.length; i < len; i++){
newxmllist += a[i];
}
tra
Merrill, Jason skriver:
Get an XMLList of all the nodes where the "aaa" attribute has a value of
"eee":
That's selection, not sorting.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashc
>> He never once made it look like selection. It is clearly a sorting
task.
>> He wants all the nodes, but in a different order, one defined by the
ordering
>> of their value fora given attribute.
Really? You're so sure? All he said was, "Any easy way to sort xml
based on an attribute: so if I
Merrill, Jason skriver:
That's selection, not sorting.
What is the difference from what he's trying to accomplish?
the end result?
He never once made it look like selection. It is clearly a sorting task.
He wants to sort the xml elements based on their attribute values.
He wants all the n
Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik
Andersson
Sent: Tuesday, August 31, 2010 11:39 AM
To: Flash Coders List
Subject: Re: [Flashcoders] sorting xml
Merrill, Jason skriver:
> Get an XMLList of all the n
n...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Tuesday, August 31, 2010 10:28 AM
To: Flash Coders List
Subject: [Flashcoders] sorting xml
Any easy way to sort xml based on an attribute:
so if I wanted to sort based on aas or ccc
__
Any easy way to sort xml based on an attribute:
so if I wanted to sort based on aas or ccc
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
8 matches
Mail list logo