Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting XML by creating an object

Status
Not open for further replies.

JoeMcGarvey

Programmer
Oct 31, 2002
47
US
I found a thread with an example provided by Danfood. This HTML example loads an XML and XSL file and outputs the result beautifully and simply in IE. Unfortunately, it only works with IE. Can anyone point me in the right direction towards making this script Mozilla compatible?

Thanks All!

ORIGINAL EXAMPLE BY DANFOOD

<html>
<head><title> YOUR TITLE </title>

<link rel=&quot;STYLESHEET&quot; type=&quot;text/css&quot; href=&quot;YOUR STYLESHEET.css&quot; />

<xml id=&quot;GIVE IT AN ID&quot; src=&quot;YOUR XML FILE.xml&quot;></xml>


</head>


<script language=&quot;javascript&quot;>
// Load XML
var xml = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;)
xml.async = false
xml.load(&quot;YOUR XML FILE.xml&quot;)

// Load the XSL
var xsl = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;)
xsl.async = false
xsl.load(&quot;THE XSL FILE TO DISPLAY THE XML.xsl&quot;)


// Transform
document.write(xml.transformNode(xsl))


</script>
</body>
</html>
 
In my post I noted that this only works in IE... I am looking for a Mozilla implementation. Can seem to dig one up...

Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top