# Tracing the number of quotes in an xml file

**URL:** <https://forum.kirupa.com/t/tracing-the-number-of-quotes-in-an-xml-file/308304>\
**Category:** Uncategorized\
**Created:** [April 20, 2010, 6:57pm UTC](https://forum.kirupa.com/t/tracing-the-number-of-quotes-in-an-xml-file/308304 "2010-04-20T18:57:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![webguync](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/webguync/32/2434_2.png) [@webguync](https://forum.kirupa.com/u/webguync)\
**Post date:** [April 20, 2010, 6:57pm UTC](https://forum.kirupa.com/t/tracing-the-number-of-quotes-in-an-xml-file/308304/1 "2010-04-20T18:57:57Z")

</div>

I am trying to trace out the number of quotes in an XML file, but I am getting a 1 in the output window which I know is incorrect.

In my as I have

```auto

//we create a variable to store the loaded XML
var xml:XML;
//the path to the xml file
var xmlPath:String = "data/quotes.xml";
//we create a loader and when the loading is over we call the xmlComplete function
var loader:URLLoader = new URLLoader();
//a url request for our loader
var req:URLRequest = new URLRequest(xmlPath);
loader.addEventListener(Event.COMPLETE, xmlComplete);
loader.load(req);
//a variable for our tween
var myTween:Tween;
//we need to set a timer 
var timer:Timer = new Timer(5000);
timer.addEventListener(TimerEvent.TIMER, changeQuotes);
timer.start();

function xmlComplete(e:Event):void{
    xml = new XML(e.target.data);
    addQuotes();
    randomQuoteTween();
    trace(xml.quote.length());
}

```

the XML file look like this:

```auto

<?xml version="1.0" encoding="UTF-8"?>
<data>

    <quotes>
    
        <quote>
            <content>A friend is someone with whom you dare to be yourself.</content>
            <author>Frank Crane</author>
        </quote>
        <quote>
            <content>Treat your friends as you do your pictures, and place them in their best light. Treat your friends as you do your pictures, and place them in their best light.</content>
            <author>Jennie Jerome Churchill</author>
        </quote>
        <quote>
            <content>A true friend never gets in your way unless you happen to be going down. A true friend never gets in your way unless you happen to be going down.</content>
            <author>Arnold H. Glasgow</author>
        </quote>
        <quote>
            <content>The road to a friend's house is never long.</content>
            <author>Danish Proverb</author>
        </quote>
        <quote>
            <content>Be a friend to thyself, and others will be so too.</content>
            <author>Thomas Fuller</author>
        </quote>
</data>

```

am I putting the trace in the wrong place?
