XML document transformation code for Mozilla, Safari, etc...
-
Hi, can anyone help with me this as I'm relatively new with XML programming. I have code that's running perfectly in IE 7 but I'm no able to run it in other browser say Mozilla Firefox 3.0. Could you please let me know the equivalent code for transformation of XML document. I have pasted the code I have used for IE 7. Please help!!! Home.xsl: <xsl:template match="root/HOMEPAGE" xmlns:xsl="#unknown"> TEST </xsl:template> Home.xml : <root> <homepage> <detail></detail> </homepage> </root> Here is the code which has been used for I.E I want an equivalent code for Mozilla etc var objXMLHome = new ActiveXObject("Msxml2.DOMDocument"); objXMLHome.async = false; objXMLHome.resolveExternals = false; objXMLHome.setProperty("SelectionLanguage", "XPath") objXMLHome.load("XML/Home.xml"); var objXSLHome = new ActiveXObject("Microsoft.XMLDOM") objXSLHome.async = false objXSLHome.load("XSL/Home.xsl"); document.all("divHEADER").innerHTML = objXMLHome.selectSingleNode("//HOMEPAGE").transformNode(objXSLHome.documentElement);
-
Hi, can anyone help with me this as I'm relatively new with XML programming. I have code that's running perfectly in IE 7 but I'm no able to run it in other browser say Mozilla Firefox 3.0. Could you please let me know the equivalent code for transformation of XML document. I have pasted the code I have used for IE 7. Please help!!! Home.xsl: <xsl:template match="root/HOMEPAGE" xmlns:xsl="#unknown"> TEST </xsl:template> Home.xml : <root> <homepage> <detail></detail> </homepage> </root> Here is the code which has been used for I.E I want an equivalent code for Mozilla etc var objXMLHome = new ActiveXObject("Msxml2.DOMDocument"); objXMLHome.async = false; objXMLHome.resolveExternals = false; objXMLHome.setProperty("SelectionLanguage", "XPath") objXMLHome.load("XML/Home.xml"); var objXSLHome = new ActiveXObject("Microsoft.XMLDOM") objXSLHome.async = false objXSLHome.load("XSL/Home.xsl"); document.all("divHEADER").innerHTML = objXMLHome.selectSingleNode("//HOMEPAGE").transformNode(objXSLHome.documentElement);