# Simple? loop and parse xml to var's

**URL:** https://forum.kirupa.com/t/simple-loop-and-parse-xml-to-vars/161681
**Category:** Uncategorized
**Created:** [September 6, 2005, 9:09am UTC](https://forum.kirupa.com/t/simple-loop-and-parse-xml-to-vars/161681 "2005-09-06T09:09:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![peshay](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@peshay](https://forum.kirupa.com/u/peshay)
#### Post date: [September 6, 2005, 9:09am UTC](https://forum.kirupa.com/t/simple-loop-and-parse-xml-to-vars/161681/1 "2005-09-06T09:09:19Z")

</div>

Hi, im trying to parse a XML file so that all the "text"nodes in a certain language are defined as var’s along with their values. As you might have guessed i cant get it to work. this is my xml;

```auto

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
	<english>
		<screen1>
			<text1-1>bla 1-1</text1-1>
			<text1-2>bla 1-2</text1-2>
		</screen1>

	</english>

	<dutch>
		<screen1>
			<text1-1>bla dutch 1-1</text1-1>
			<text1-2>bla dutch 1-2</text1-2>
		</screen1>

	</dutch>
</data>

```

i need to loop through the document and then do \_root[textname]=textvalue; so it becomes \_root[text1-1]=“bla 1-1”  
i thought something like this might do the trick, but i can only get the first value with it. So when i change any 0 into a 1 it doesnt work anymore.

```auto

trace( xmlNode.childNodes[0].childNodes[0].childNodes[0].childNodes[0].firstChild.nodeValue

```

Could someone please help me?
