# Matching the results of an XML in AS3

**URL:** <https://forum.kirupa.com/t/matching-the-results-of-an-xml-in-as3/241348>\
**Category:** open source\
**Created:** [October 12, 2007, 1:16pm UTC](https://forum.kirupa.com/t/matching-the-results-of-an-xml-in-as3/241348 "2007-10-12T13:16:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tezzutezzu](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tezzutezzu](https://forum.kirupa.com/u/tezzutezzu)\
**Post date:** [October 12, 2007, 1:16pm UTC](https://forum.kirupa.com/t/matching-the-results-of-an-xml-in-as3/241348/1 "2007-10-12T13:16:14Z")

</div>

Hey guys, I just wanted to share this:  
I wondered how to create arrays for categories automatically from my blog (wordpress) rss feed and it was quite easy thanks to the filter array method.

here’s the code:

```auto

private function createItems():void {
            for each (var cat:XML in _items.category) {
                if (_categories.length>0) {
                    if (_categories.filter(checkThis)==false) {
                        _categories.push(cat);
                    }
                } else {
                    _categories.push(cat);
                }
            }
            function checkThis(element:*, index:int, arr:Array):Boolean {
                if (element.text()==cat.text()) {
                    return true;
                } else {
                    return false;
                }
            }
            trace("categories are:"+_categories);
        }

```

\_items is an XMLList created by XML…items method

don’t know if it was already posted (maybe in the AS3 tip of the day) if so i apologize 🙂
