# Shop cart xml = show number of items and values

**URL:** https://forum.kirupa.com/t/shop-cart-xml-show-number-of-items-and-values/291854
**Category:** flash
**Created:** [July 6, 2009, 7:20pm UTC](https://forum.kirupa.com/t/shop-cart-xml-show-number-of-items-and-values/291854 "2009-07-06T19:20:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Only\_Dust](https://avatars.discourse-cdn.com/v4/letter/o/f1d935/32.png) [@Only\_Dust](https://forum.kirupa.com/u/Only_Dust)
#### Post date: [July 6, 2009, 7:20pm UTC](https://forum.kirupa.com/t/shop-cart-xml-show-number-of-items-and-values/291854/1 "2009-07-06T19:20:23Z")

</div>

[LEFT]Hi, I do not have much knowledge with xml, I have two fields, one for items and other values, I want to show the total of each field.

[LEFT]I’m using a model of the gallery’s xml kirupa tutorials.

The XML:

```auto

<images>
    <pic>
        <itens>1</itens>
        <valor>12,55</valor>
    </pic>
    <pic>
        <itens>2</itens>
        <valor>65,88</valor>
    </pic>
</images>

```

The AS:

```auto

stop();
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        itens = [];
        valor = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            itens* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
            valor* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
        }
        picture_num();
    } else {
        content = "file not loaded!";
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

function picture_num() {

    pos_txt.text = current_pos+" / "+total;
    itens_txt.text = itens[0] + itens[0]; 
    valor_txt.text = valor[1] + valor[1];
}

```

I want to add the values.  
The itens field need to show: 3  
The Price field need to show: 78,43

but now they are showing:  
The itens field need to show: 11  
The Price field need to show: 65,8865,88

Somebody can help me?

Sorry about my English.  
[/LEFT]

[/LEFT]
