Hello,
I have the following javascription function that validates a xml document that is contained within a textarea called "validxml".
The problem is that this code only works for IE.... I need it to work with Netscape/Mozilla
Could you help me please?
THank you
I have the following javascription function that validates a xml document that is contained within a textarea called "validxml".
Code:
function validateXML()
{
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(document.all("validxml").value);
if(xmlDoc.parseError.errorCode!=0)
{
txt="Error Code: " + xmlDoc.parseError.errorCode + "\n";
txt=txt+"Error Reason: " + xmlDoc.parseError.reason;
txt=txt+"Error Line: " + xmlDoc.parseError.line;
document.forms["rule"].validxml.focus();
alert(txt);
}
else
{
alert("No errors found");
}
}
Could you help me please?
THank you