Hi there!
I read an XML in my page and I’ve added a CDATA section where I do a bit of formatting. The XML loads properly in all browsers but with IE it stops loading when it gets to this section. I have tried getting rid of the Cdata and just escaping the < and > but made no difference. It seems like it cannot handle the tags such as <p> and <br/>.
Any idea would be helpful, I haven’t found any relevant documentation. The code in my html page is as follows:
[COLOR=Navy]<script type=“text/javascript”>
var product = window.opener.message;
document.title = product;
var xmlStr = “xml/” + product + “.xml”;[/COLOR]
[COLOR=Navy]function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
{// code for IE7, Firefox, Mozilla, etc.
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{// code for IE5, IE6
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
if (xmlhttp!=null)
{
xmlhttp.onreadystatechange=onResponse;
xmlhttp.open(“GET”,url,true);
xmlhttp.send("");
}
else
{
alert(“Your browser does not support XMLHTTP.”);
}
}
function onResponse()
{
if(xmlhttp.readyState!=4) return;
if(xmlhttp.status!=200)
{
alert(“Problem retrieving XML data”);
return;
}
{
document.getElementById(“name”).innerHTML=xmlhttp.responseXML.getElementsByTagName(“NAME”)[0].childNodes[0].nodeValue;
document.getElementById(“myPic”).src=xmlhttp.responseXML.getElementsByTagName(“IMAGE”)[0].childNodes[0].nodeValue;
document.getElementById(“pack”).innerHTML=xmlhttp.responseXML.getElementsByTagName(“PACK”)[0].childNodes[0].nodeValue;
document.getElementById(“des”).innerHTML=xmlhttp.responseXML.getElementsByTagName(“DES”)[0].childNodes[0].nodeValue;
document.getElementById(“incr”).innerHTML=xmlhttp.responseXML.getElementsByTagName(“INCR”)[0].childNodes[0].nodeValue;
document.getElementById(“use”).innerHTML=xmlhttp.responseXML.getElementsByTagName(“USE”)[0].childNodes[0].nodeValue;
}
}
</script>[/COLOR]
And an XMl file example:
[COLOR=RoyalBlue]<?xml version=“1.0” encoding=“UTF-8”?>
<PRODUCT>
<NAME>ALGAE AND ARGIL BODY MASK </NAME>
<IMAGE>images/detailed/bodymask/algargil.jpg</IMAGE>
<PACK><![CDATA[
Professional use packaging buckets of 500ml, 1000ml, 5000ml
]]></PACK>
<DES>Body mask with natural green clay and seaweed powder for body slimming and firming treatments. This mineral-rich purifying mask also contains a blend of soothing, slimming and anti-oxidant natural extracts leaving the body skin cleansed, detoxified and smooth.
</DES>
<INCR><![CDATA[<p>MAIN INCREDIENTS</p>
<b>Green Clay:</b> A natural bio-mineral used for centuries for its therapeutic properties. Contains many trace minerals and phyto-nutrients. It is very absorbent, detoxifies and removes dead skin cells, absorbs impurities and fats. Its toning action stimulates the skin by bringing fresh blood to damaged skin cells, revitalizing the complexion, and tightening pores. Stimulates, also, the blood and lymph circulation and strengthens the connective tissues.<br/>
]]></INCR>
<USE><![CDATA[<p>USE</p>
Evenly apply the mask on the whole body. Once applied, wrap the body in a plastic sheet. After 30 minutes remove it with water.
]]></USE>
</PRODUCT>
[COLOR=Black]THANKS!!![/COLOR]
[/COLOR]