Click to See Complete Forum and Search --> : XML/XSL/Javascript browser issue


ccoston
10-25-2006, 04:58 AM
I had to change my web hosting company and I changed from an IIS based server to an Apache server with no ASP support, so I had to change all my ASP.NET code to javascript (I don't know PHP).

I have pages that retrieve news from an XML file through javascript. The XML is processed by an XSL file and then returned. In Internet Explorer, it functions beautifully. However, testing in Netscape and Firefox has shown that nothing is displayed.

Here is the code:

<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("xml/news.xml")

// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("xml/xmlsort.xsl")

// Transform
document.write(xml.transformNode(xsl))
</script>

Anyone have any ideas? I'm not sure at which point the problem is occurring.

Charles
10-25-2006, 05:07 AM
You'll also find that it doesn't work for a good number of MSIE users. Do not rely upon JavaScript and ignorance is no excuse. PHP is way easy to learn; see http://www.php.net/manual/en/ .