# XML Question

**URL:** <https://forum.kirupa.com/t/xml-question/175616>\
**Category:** Uncategorized\
**Created:** [January 16, 2006, 12:26pm UTC](https://forum.kirupa.com/t/xml-question/175616 "2006-01-16T12:26:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ice987](https://avatars.discourse-cdn.com/v4/letter/i/779978/32.png) [@ice987](https://forum.kirupa.com/u/ice987)\
**Post date:** [January 16, 2006, 12:26pm UTC](https://forum.kirupa.com/t/xml-question/175616/1 "2006-01-16T12:26:35Z")

</div>

Is the following .xml file structure ok ?

\<data\>  
\<pic\>  
\<image\>bracelet.jpg\</image\>  
\<caption\>bracelet\</caption\>  
\</pic\>  
\<pic\>  
\<image\>necklace.jpg\</image\>  
\<caption\>necklace\</caption\>  
\</pic\>

\<info\>  
\<name\>Bracelet\</name\>  
\<value\>2000\<value\>  
\</info\>

\<info\>  
\<name\>Necklace\</name\>  
\<value\>500\<value\>  
\</info\>

\<notes\>  
\<general\>Included Notes\</general\>  
\</notes\>

\</data\>

if so, how do I access the values and put them into 4 arrays and a notes variable

images[]  
captions[]  
names[]  
value[]  
notes

I would begin

xmlNode = this.firstChild;  
images = [];  
captions = [];  
names = [];  
values = [];  
totalimages = xmlNode.childnodes.childNodes.length;  
for (i=0; i\<totalimages; i++) {  
images\* = xmlNode.childNodes\*.childNodes\*.firstChild.nodeValue;

Not sure if the above is correct and how to continue…
