# Rendering xml as html in text field

**URL:** <https://forum.kirupa.com/t/rendering-xml-as-html-in-text-field/176322>\
**Category:** Uncategorized\
**Created:** [January 22, 2006, 10:08pm UTC](https://forum.kirupa.com/t/rendering-xml-as-html-in-text-field/176322 "2006-01-22T22:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tay511](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@Tay511](https://forum.kirupa.com/u/Tay511)\
**Post date:** [January 22, 2006, 10:08pm UTC](https://forum.kirupa.com/t/rendering-xml-as-html-in-text-field/176322/1 "2006-01-22T22:08:46Z")

</div>

Hi,

I have a simple xml file with this structure.

\<?xml version=“1.0” encoding=“iso-8859-1”?\>  
\<content\>  
\<page name=“Page Name”\>  
\<text\>  
\<p\>This is line 1…\</p\>  
\<p\>This is line 2…\</p\>  
\<p\>This is line 3…etc\</p\>  
\</text\>  
\</page\>  
\</content\>

I can update a text field to show the page name attribute but I cannot get another text field to show the text content rendered as html.

The ‘render as html’ option is selected but the \<p\> tags don’t render as expected.

What am I doing wrong?? I’m thinking it’s something simple!

T

---

<div class="post-metadata">

**Author:** ![filefile](https://avatars.discourse-cdn.com/v4/letter/f/8baadc/32.png) [@filefile](https://forum.kirupa.com/u/filefile)\
**Post date:** [April 25, 2006, 9:23am UTC](https://forum.kirupa.com/t/rendering-xml-as-html-in-text-field/176322/2 "2006-04-25T09:23:24Z")

</div>

I got same problem the text from CDATA rendered like this:

```auto
<b>hello</b><br>help.

```

in my textFieldMC.field.htmlText

and redered like this:

```auto
<b>hello</b><br>help.

```

in my textFieldMC.field.text

and redered prefectly fine if i’m doing this:

```auto
textFieldMC.field.html="this is <b>bold</b><br>this is <i>italic</i>";

```

why is that?? And also what’s up with the bracketed number behind childNodes?? I mean this:

```auto
xmlObj.firstChild.childNodes[1].childNode.nodeValue

```

Thanks in advance

---

<div class="post-metadata">

**Author:** ![filefile](https://avatars.discourse-cdn.com/v4/letter/f/8baadc/32.png) [@filefile](https://forum.kirupa.com/u/filefile)\
**Post date:** [April 25, 2006, 9:24am UTC](https://forum.kirupa.com/t/rendering-xml-as-html-in-text-field/176322/3 "2006-04-25T09:24:18Z")

</div>

I got same problem the text from CDATA rendered like this:

```auto
<b>hello</b><br>help.

```

in my textFieldMC.field.htmlText

and redered like this:

```auto
&lt;b&gt;hello&lt;/b&gt;&lt;br&gt;help.

```

in my textFieldMC.field.text

and redered prefectly fine if i’m doing this:

```auto
textFieldMC.field.html="this is <b>bold</b><br>this is <i>italic</i>";

```

why is that?? And also what’s up with the bracketed number behind childNodes?? I mean this:

```auto
xmlObj.firstChild.childNodes[1].childNode.nodeValue

```

Thanks in advance
