PDA

View Full Version : Why loadXML(xmlStr) dont work??


umen
06-18-2003, 09:47 PM
Hello
i have this simple script that
suppose to load xml string and then attach it xsl and innerHTML it to div
but its not showing me nothing , when i alert the "srcTree.xml" (xml the method that is...)
i do get the vaild xml string structer but none is shown in the HTML
and the xsltTree.parseError.errorCode gives me 0
i have something like this:
-----------------------------------------------
function init()
{
var xmlStr = theXml.innerHTML;
var srcTree = new ActiveXObject('Microsoft.XMLDOM');
srcTree.async=false;
srcTree.loadXML(xmlStr);

try{ alert(srcTree.xml)}catch(e){alerte(e);}parseError.errorCode

var xsltTree= new ActiveXObject('Microsoft.XMLDOM');
xsltTree.async = false;
xsltTree.load("foo.xsl");
try{ alert(xsltTree.parseError.errorCode)}catch(e){alerte(e);}
resTree.innerHTML = srcTree.transformNode(xsltTree);
}


thanks