# Help formatting XML Text in AS3 file

**URL:** <https://forum.kirupa.com/t/help-formatting-xml-text-in-as3-file/313063>\
**Category:** flash\
**Created:** [August 18, 2010, 11:11pm UTC](https://forum.kirupa.com/t/help-formatting-xml-text-in-as3-file/313063 "2010-08-18T23:11:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccbass85](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@ccbass85](https://forum.kirupa.com/u/ccbass85)\
**Post date:** [August 18, 2010, 11:11pm UTC](https://forum.kirupa.com/t/help-formatting-xml-text-in-as3-file/313063/1 "2010-08-18T23:11:07Z")

</div>

Hi Everyone,

I’m importing text via an XML file that will then be displayed in a dynamic text field. The text is about 1 sentence long but one of the words in the sentence must be bold and a different color. So I’ve added some HTML tags in the XML node to change the color and format but when I test the file the html tags show in the dynamic text field and the text is NOT formatted. I’m not sure what I’m doing wrong.

Here is my code:

I bring in the XML data with this AS3 code:

```auto

var _xml:XML;
var _xmlList:XMLList;
var _xmlLoader:URLLoader = new URLLoader();

_xmlLoader.load(new URLRequest("xml/step1.xml"));
_xmlLoader.addEventListener(Event.COMPLETE, loadXMLData);

function loadXMLData(event:Event):void
{
	_xml = XML(event.target.data);
	_xmlList = _xml.children();
	//trace(_xmlList[_arrayIndex].quest);
	test_txt.text = _xmlList[0].quest;
}

```

And this is what my XML file looks like:

```auto

<?xml version="1.0" encoding="UTF-8"?>
<questions>

<question>
   <quest><![CDATA[According to the national average, how many<font color="#C50100"><b> home fires</b></font> occur each day in the United States?]]></quest>
</question>

</questions>

```

Am I not using the CDATA tag properly? Or do I need to change something in the way I call up the data in the xml node ?I’m really confused as to what isn’t working. Thanks in advance for the help.
