# Getting HTML text from XML file

**URL:** <https://forum.kirupa.com/t/getting-html-text-from-xml-file/45516>\
**Category:** Uncategorized\
**Created:** [March 15, 2004, 2:22pm UTC](https://forum.kirupa.com/t/getting-html-text-from-xml-file/45516 "2004-03-15T14:22:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AXiAL](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@AXiAL](https://forum.kirupa.com/u/AXiAL)\
**Post date:** [March 15, 2004, 2:22pm UTC](https://forum.kirupa.com/t/getting-html-text-from-xml-file/45516/1 "2004-03-15T14:22:08Z")

</div>

I am loading an XML file into a dynamic textfield in flash.

Is it possible to load in HTML text from the XML file… If so how??

my XML file looks like this

```auto
<?xml version="1.0" encoding="iso-8859-1"?>
<news>
	<entry
		date="10th Feb, 2004"
		description="First Version of site. Still Working Refining."
	/>
	<entry
		date="10th Feb, 2004"
		description="check out <a href='http://www.xotyx.com/'> Xotyx.com</a>"
	/>
</news>

```

Flash reads in the XML but doesnt display the second entry… So the code is not right… Here is the AS…

[AS]  
// reading in XML…  
var news = new XML();  
news.ignoreWhite = true;  
var entry = 0;  
var total = 0;  
var current = 0;

news.load(“news.xml”);  
news.onLoad = function(success) {  
\_root.total = this.firstChild.childNodes.length;  
if (success) {  
\_root.entry = \_root.total - 1;  
for (i=\_root.total; i \> 0; i–)  
{  
date\_txt = this.firstChild.childNodes[\_root.entry].attributes.date;  
description\_txt = this.firstChild.childNodes[\_root.entry].attributes.description;

scrollerTxt = scrollerTxt + date\_txt + "  
" + description\_txt + "

";  
\_root.entry–;  
}  
//newTxt is the instance name of they dynmic textfield.  
newsTxt.htmlText = scrollerTxt;  
}  
};  
[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 15, 2004, 4:47pm UTC](https://forum.kirupa.com/t/getting-html-text-from-xml-file/45516/2 "2004-03-15T16:47:32Z")

</div>

you have to use \< and \> to escape the \< and \>.

or you could use \<![CDATA[]]\> sections, but that is a little advanced 🙂
