# Getting html text to display from xml file usning CDATA

**URL:** <https://forum.kirupa.com/t/getting-html-text-to-display-from-xml-file-usning-cdata/273338>\
**Category:** Uncategorized\
**Created:** [October 14, 2008, 4:06pm UTC](https://forum.kirupa.com/t/getting-html-text-to-display-from-xml-file-usning-cdata/273338 "2008-10-14T16:06:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecarte](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ecarte/32/467_2.png) [@ecarte](https://forum.kirupa.com/u/ecarte)\
**Post date:** [October 14, 2008, 4:06pm UTC](https://forum.kirupa.com/t/getting-html-text-to-display-from-xml-file-usning-cdata/273338/1 "2008-10-14T16:06:14Z")

</div>

Hi  
I am trying to get a link to work in the body text of a text block.  
I am using CDATA but can not get this to translate to html in the flash. I have checked that the ‘Render text as html’ box is checked.  
What is it that I am not doing? or not doing right?

Below is my AS and below that is my XML

# ======================== xml menu stripped down

function CreateMenu(menu\_xml) {  
var items = menu\_xml.firstChild.firstChild.childNodes;  
for (var i = 0; i \< items.length; i++)  
{  
if (items\*.attributes.type == “news”)  
{  
var header = items\*.firstChild;  
var article = items\*.childNodes[1];  
var item\_mc = menu\_mc.attachMovie(“menu\_item”, “item” + item\_count, item\_count);  
item\_mc.\_y = item\_count \* item\_spacing;  
item\_count++;  
item\_mc.header\_txt.text = header.firstChild.nodeValue; //  
item\_mc.main\_mc.content\_text = article.firstChild.nodeValue; // this is the content but is I use htmlText it throws an error  
item\_mc.main\_mc.onRelease = DisplayInfo;  
}  
}  
}  
var news\_xml = new XML();  
news\_xml.ignoreWhite = true;  
news\_xml.onLoad = function(success) {  
if (success)  
{  
CreateMenu(this);  
}  
else  
{  
trace(“Error loading XML file”);  
}  
};  
news\_xml.load(“news\_url.xml”);

# =================== xml file below

\<?xml version=“1.0” encoding=“utf-8”?\>  
\<menu\>  
\<menuitems\>  
\<item type=“news”\>  
\<header\>Heading\</header\>  
\<article\>\<![CDATA[Some \<br\>text here\<br\>\<font size=“16” color="#999999"\>And some text \<a href=“[http://www.website.com](http://www.website.com)” target="\_blank"\>\<b\>here\</b\>\</a\>\</font\> \<img src=“any.jpg”/\>]]\>\</article\>  
\</item\>

\</menuitems\>  
\</menu\>
