Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This thread looks like the same thing I am looking for but I don't see any of your examples. Is there a reason they are not visible? I could really use some help on this as well. Thank you in advance.
Copy link to clipboard
Copied
This thread was "imported" from the old forums -- most, if not all, code seems to have disappeared. But here are the sort functions I posted:
function sortXML(source:XML, elementName:Object, fieldName:Object,
options:Object = null):XML
{
// list of elements we're going to sort
var list:XMLList=source.elements("*").(name()==elementName);
// list of elements not included in the sort -
// we place these back into the source node at the end
var excludeList:XMLList=source.elements("*").(name()!=elementName);
list= sortXMLList(list,fieldName,options);
list += excludeList;
source.setChildren(list);
return source;
}
function sortXMLList(list:XMLList, fieldName:Object, options:Object =
null):XMLList
{
var arr:Array = new Array();
var ch:XML;
for each(ch in list)
{
arr.push(ch);
}
var resultArr:Array = fieldName==null ?
options==null ? arr.sort() :arr.sort(options)
: arr.sortOn(fieldName, options);
var result:XMLList = new XMLList();
for(var i:int=0; i<resultArr.length; i++)
{
result += resultArr;
}
return result;
}
Copy link to clipboard
Copied
thank you so much Raymond to repost your great functions !!!!!
you make my day ![]()
Cédric
Copy link to clipboard
Copied
100% usefull! thanks!
Copy link to clipboard
Copied
Thanks Raymond, you saved my day ![]()
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more