# Xml and numbers

**URL:** <https://forum.kirupa.com/t/xml-and-numbers/113037>\
**Category:** Uncategorized\
**Created:** [June 14, 2004, 1:02pm UTC](https://forum.kirupa.com/t/xml-and-numbers/113037 "2004-06-14T13:02:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasier](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@Nasier](https://forum.kirupa.com/u/Nasier)\
**Post date:** [June 14, 2004, 1:02pm UTC](https://forum.kirupa.com/t/xml-and-numbers/113037/1 "2004-06-14T13:02:59Z")

</div>

hi,

My problem is a bit more complex as I describe here but if someone can help me with this im sure I’ll figure out the rest myself.

I’ve a xml file that looks something like:

\< h e l l o \>  
\< t e s t \> 2 0 \< / t e s t \>  
\< / h e l l o\>

after I load the xml into flash and use the following actionscript:

```auto
forExample = example.childNodes[0].childNodes[0];

```

it displays 20 on the screen.

But now I like to add 2.

So I thought:

```auto
showMe22 = forExample + 2;

```

but unfortunatly that doesnt work… it displays “NaN” instead of 22.

For some reason it doesnt see 20 as a integer (but as text?). How can I solve this problem n make it display 22?

Thanx in advance.

Nasier

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 15, 2004, 5:39pm UTC](https://forum.kirupa.com/t/xml-and-numbers/113037/2 "2004-06-15T17:39:57Z")

</div>

maybe try containing it within an attribute instead of a text node.

\<hello\>  
\<test number=“20” /\>  
\</hello\>

num = XMLobj.firstChild.firstChild.attributes.number;

num+=2;

num should equal 22;

hope that helps.

CC
