# MX2004: XPathAPI CDATA selectSingleNode and HTML formatting

**URL:** <https://forum.kirupa.com/t/mx2004-xpathapi-cdata-selectsinglenode-and-html-formatting/165527>\
**Category:** flash\
**Created:** [October 11, 2005, 7:50pm UTC](https://forum.kirupa.com/t/mx2004-xpathapi-cdata-selectsinglenode-and-html-formatting/165527 "2005-10-11T19:50:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loque](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Loque](https://forum.kirupa.com/u/Loque)\
**Post date:** [October 11, 2005, 7:50pm UTC](https://forum.kirupa.com/t/mx2004-xpathapi-cdata-selectsinglenode-and-html-formatting/165527/1 "2005-10-11T19:50:49Z")

</div>

Hello,

my subject is pretty much my problem, i am using MX2004’s XPathApi ‘selectSingleNode’ which is working nicely, i have done a wee bit of fiddling;

```auto

_root.selectedText = "About Us "
centreMe.textContent.htmlText = mx.xpath.XPathAPI.selectSingleNode(this.firstChild, "/data/item[@name = '"+ _root.selectedText + "']/*");

```

I would like to be able to change the content depending on what the variable is, and this seems to work fine. The content should be formatted text (with

etc…), so i am using CDATA tags to make sure no confusion is made with \<\>'s (and if i dont it only pulls in a small section - as expected).

Only problem is that for some reason it forgets it is a html formatted bit of CDATA and spits out the

tags with the rest of the content… i have placed in “centreMe.textContent.html = true;” make sure it knows its html but it really doesnt want to know.

I tried using selectNodeList to an array and printing this - which works, without CDATA tags, but adds a really annoying “,” at the end of each “array item” it is printing.

Any help would be fantastic as i have also been through an entire saga to get here trying different techniques to get html tags displaying correctly within CDATA - and i guess this is ultimately my problem?

Thanks for your time!  
Løque

* * *

edit \> now i am having a really “noobie” problem (if my one above wasnt already enough)

this works;

```auto
bla.html = true;
bla.htmlText = "this is frustrating?";

```

but this doesnt display anything in my dynamic textbox;

```auto
bla.html = true;
bla.htmlText = "<b> this is frustrating?</b>";

```

why does actionscript hate me? its player 7 with as2 😑
