PDA

View Full Version : xml CDDATA and html problem


Shaolins-Finest
09-08-2008, 02:27 PM
Hi Guys

I am using CDDATA in my XML to handle html tags etc as follows:

<content>
<![CDATA[<p>welcome</p> Thanks for visiting our <strong>website</strong>]]>
</content>

The problem is when I move the data into the html the htmltags dont get rendered and stay as is. Does anyone know how I can change it so that the html tags are proccessed once in the html file ?

Jon Hanlon
09-08-2008, 05:46 PM
How are you moving the data into the html?

Shaolins-Finest
09-08-2008, 08:31 PM
This is the method I used:

getElementsByTagName("content")[i].firstChild.nodeValue

Jon Hanlon
09-08-2008, 10:14 PM
OK, but what's the whole statement?
That's the RHS of the assignment, what's on the left?

Shaolins-Finest
09-08-2008, 10:49 PM
var xhr = CreateRequest();
xhr.open("GET",link,false);
xhr.send(null);
if(xhr.status==200) {
var x1 = xhr.responseXML;
var td2=document.createElement('td');
var td2spantxt = document.createTextNode(x1.getElementsByTagName("content")[i].firstChild.nodeValue);
td2.appendChild(td2spantxt );
tbody.appendChild(td2);
table.appendChild(tbody);
}