# XML should i parse in arrays?

**URL:** <https://forum.kirupa.com/t/xml-should-i-parse-in-arrays/258225>\
**Category:** Uncategorized\
**Created:** [April 22, 2008, 8:31am UTC](https://forum.kirupa.com/t/xml-should-i-parse-in-arrays/258225 "2008-04-22T08:31:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keitai](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@keitai](https://forum.kirupa.com/u/keitai)\
**Post date:** [April 22, 2008, 8:31am UTC](https://forum.kirupa.com/t/xml-should-i-parse-in-arrays/258225/1 "2008-04-22T08:31:11Z")

</div>

Hi there,

i am not sure how to parse this xml file so i can use it in flash

```auto

<?xml version="1.0" encoding="utf-8"?>
    <website>
      <page id="1">
        <pageTitle>
asdfasdf
        </pageTitle>
        <pageContent>
asdfasdf
        </pageContent>
        <pageQuote />
      </page>
      <page id="2">
        <pageTitle>
title pag2
        </pageTitle>
        <pageContent>
page 2 content
        </pageContent>
        <pageQuote>
hi world
        </pageQuote>
      </page>
    </website>

```

and in flash

```auto

xmlwebsiteContent.onLoad = loadWebsiteContent;

function loadWebsiteContent(loaded)
{
	if (loaded)
	{
		var pagesNode = this.firstChild.childNodes;
		for(var i=0 ;i <pagesNode.length;i++){
			pageItems = pagesNode*;
			pageNr = pageItems.attributes.id;
			pageTitle = pageItems.childNodes[0].firstChild.nodeValue;
			pageContent = pageItems.childNodes[1].firstChild.nodeValue;
			pageQuote = pageItems.childNodes[2].nodeName;
			trace(pageNr);
			trace(pageTitle);
			trace(pageContent);
			trace("--------------------------------------");
	}

```

Should i created an array like

```auto

var websiteContent:Array;
websiteContent = [[page1 title, page1 content, page1 Qoute],[page2 title, page2 content, page2 Qoute]]

```

Please advice
