# Recursive xml

**URL:** https://forum.kirupa.com/t/recursive-xml/228878
**Category:** Uncategorized
**Created:** [June 12, 2007, 6:29am UTC](https://forum.kirupa.com/t/recursive-xml/228878 "2007-06-12T06:29:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![roleiflex](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@roleiflex](https://forum.kirupa.com/u/roleiflex)
#### Post date: [June 12, 2007, 6:29am UTC](https://forum.kirupa.com/t/recursive-xml/228878/1 "2007-06-12T06:29:15Z")

</div>

Hi,  
I have the following code that displays all the data in my xml file. Thats great, but I would like to separate out each node so I can apply css to it. any clues?

heres the code:

var myXML:XML = new XML();  
myXML.ignoreWhite = true;  
myXML.onLoad = processXML;  
myXML.load(“usad\_calendar.xml”);

function processXML(success:Boolean):Void {  
if (success) {  
showChildren(this.firstChild);  
}  
else {  
trace (“Error loading file”);  
}  
}

function showChildren(startNode:XMLNode):Void{  
if (startNode.nodeType == 1) {  
if (startNode.hasChildNodes()) {  
for (var i:Number = 0; i \< startNode.childNodes.length; i++) {  
if (startNode.childNodes\*.nodeType == 1) {  
}  
else {  
trace (startNode.childNodes\*.nodeValue);  
myText.styleSheet = myCSS;  
myText.htmlText = ("\<p class=‘headline’\>" + myText.htmlText + startNode.childNodes\*.nodeValue + “\</p\>\<br\>”);  
}  
showChildren(startNode.childNodes\*);  
}  
}  
}  
}
