# Reading empty nodes in XML

**URL:** <https://forum.kirupa.com/t/reading-empty-nodes-in-xml/151413>\
**Category:** Uncategorized\
**Created:** [June 15, 2005, 10:46am UTC](https://forum.kirupa.com/t/reading-empty-nodes-in-xml/151413 "2005-06-15T10:46:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryj](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jerryj](https://forum.kirupa.com/u/jerryj)\
**Post date:** [June 15, 2005, 10:46am UTC](https://forum.kirupa.com/t/reading-empty-nodes-in-xml/151413/1 "2005-06-15T10:46:02Z")

</div>

Hi,

I have seen some threads about how to detect empty nodes in XML, but I can’t make this little newsticker work. Part of the code is:  
[AS]  
function playThirdItem() {  
var my\_xml = new XML();  
my\_xml.ignoreWhite = true;  
my\_xml.onLoad = function(ok) {  
if (ok) {  
var field = MC.textfield;  
field.html = true;  
field.htmlText = this.firstChild.childNodes[2].firstChild.nodeValue;  
field.setTextFormat(fmt);  
//THIS IS WHERE I WANT TO CHECK IF THE NODE IS EMPTY OR NOT:  
if (this.firstChild.childNodes[2].firstChild.nodeValue == “”) {  
playFirstItem;  
} else {  
MC.tween("\_y", 100, 1, “linear”);  
MC.tween("\_y", 200, 1, “linear”, 3);  
MC.tween("\_y", 0, 0, “linear”, 4, playFirstItem);  
}  
}  
};  
my\_xml.load(“newsflash.xml”);  
}  
[/AS]

XML:

```auto
<news>
<item1>Jackson free man</item1>
<item2>Pope died</item2>
<item3></item3>
<item4>Berlusconi imprisoned</item4>
<item5>Bush throws party in Oval Room</item5>
<item6>New World Record 100m Swimming</item6>
</news>

```

Thank you for helping,

Jerryj.
