Difficulties to output “HTML-string code” through XML

hayalet1924

New Member
I got som difficulties to output "HTML-string code" through XML.I have presented a example below. In the server-side I have some code written in PHP.\[code\]$htmlCode = "<div>...........................</div>";header("Content-type: text/xml");echo "<?xml version='1.0' encoding='ISO-8859-1'?>";echo "<info>";echo "<htmlCode>";echo $htmlCode;echo "</htmlCode>";echo "</info>";\[/code\]The problem lies in that "HTML string code" or $htmlCode above has tag elements, so the "HTML string codes" will be treated as XML code. And I want the output to be treated as a string. And in the clientside I have a "AJAX call" to retrieve the string of HTML code. \[code\]document.getElementById('someID').innerHTML=xmlhttp.responseXML.getElementsByTagName("htmlCode")[0].childNodes[0].nodeValue;//I got nothing because the string is treated as XML code.\[/code\]How do I solve this problem? I hope I have been specific enough for you to understand my problem.
 
Back
Top