# AS3 XML List Attribute or XML push to Array Attribute Sort

**URL:** <https://forum.kirupa.com/t/as3-xml-list-attribute-or-xml-push-to-array-attribute-sort/330039>\
**Category:** flash\
**Created:** [November 21, 2012, 8:30pm UTC](https://forum.kirupa.com/t/as3-xml-list-attribute-or-xml-push-to-array-attribute-sort/330039 "2012-11-21T20:30:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashdaddy](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@flashdaddy](https://forum.kirupa.com/u/flashdaddy)\
**Post date:** [November 21, 2012, 8:30pm UTC](https://forum.kirupa.com/t/as3-xml-list-attribute-or-xml-push-to-array-attribute-sort/330039/1 "2012-11-21T20:30:36Z")

</div>

Hi All,

I’m having a tough time with something. I have an XML file that I’ve loaded into my project. Just to keep things short, let’s just say it looks like this:

```auto

<cars>
     <car make="Honda" year="2010"> 
              <model>Civic</model>
              <model>Accord</model>
     </car>
     <car make="Nissan" year="2001"> 
              <model>Altima</model>
              <model>Maxima</model>
     </car>
     <car make="Toyota" year="2012"> 
              <model>Prius</model>
              <model>Camry</model>
     </car>
</cars>

```

What I’m trying to do here is sort by year so that the order is 2001, 2010, and 2012. I’ve been searching how to sort an E4X formatted xmllist and i get a ton of results, but nothing actually works or it’s not exactly what i need. Another thing I tried was pushing each \<car\> node into an array but I’m unable to grab the @year attribute. I can do either way. Does anyone have some kind of solution to this? Your help is much appreciated.
