# Reading and writing multiple childNodes

**URL:** https://forum.kirupa.com/t/reading-and-writing-multiple-childnodes/167109
**Category:** Uncategorized
**Created:** [October 25, 2005, 3:57pm UTC](https://forum.kirupa.com/t/reading-and-writing-multiple-childnodes/167109 "2005-10-25T15:57:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@marius](https://forum.kirupa.com/u/marius)
#### Post date: [October 25, 2005, 3:57pm UTC](https://forum.kirupa.com/t/reading-and-writing-multiple-childnodes/167109/1 "2005-10-25T15:57:02Z")

</div>

function setDay(dayNode\_xml,day\_num,mc){  
trace("day: " + day\_num);  
trace("dayXML: " + dayNode\_xml.attributes.value);

```
if (dayNode_xml.attributes.value==day_num){
	//-----------------------------------------------
	var itemsNode_xml=dayNode_xml.firstChild;
	
	trace("yes entry for this day");

	while (itemsNode_xml!=null){
		if (itemsNode_xml.nodeName=="label")
	  	{
			trace("yes label: " + itemsNode_xml.nodeValue);

```

\*\* \_root[mc].label=itemsNode\_xml.firstChild.nodeValue;\*\*

[COLOR=DarkRed]THE ABOVE NEEDS TO BE MODIFIED TO ALLOW MULIPLE EVENTS… I’VE BEEN WORKING ON IT FOR DAYS… CAN ANYONE HELP?[/COLOR]

```
	  	}
	  	else if (itemsNode_xml.nodeName=="description"){
			trace("yes description: " + itemsNode_xml.nodeValue);
			_root[mc].description=itemsNode_xml.firstChild.nodeValue;
		}
		else{
			trace("error");
		}
		
		itemsNode_xml=itemsNode_xml.nextSibling;
	}
```
