|
I have the following page setup.It is meant to parse the
XML/XSL and output the result into a <div> tag to display it
onscreen. It works fine offline but when uploaded online, it doesnt work.
You can see it online at http://vrtechau.tripod.com/games/games.html
.
Thanks in advance, sorry the code's bloated
James
GAMES.HTML
<?xml version="1.0"?> <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd"> <html
xmlns="http://www.w3.org/TR/xhtml1"> <head> <title>VR
Tech - Games</title>
<link rel="StyleSheet" href="../style.css"
type="text/css" media="screen" />
<SCRIPT LANGUAGE="javascript">
<!-- Here's the script --> function
dlxml() { var source = new
ActiveXObject("Msxml2.DOMDocument"); source.async =
false; source.resolveExternals =
false; source.load("topten.xml");
var stylesheet = new
ActiveXObject("Msxml2.DOMDocument"); stylesheet.async =
false; stylesheet.resolveExternals =
false; stylesheet.load("topten.xsl");
divInfo.innerHTML =
source.transformNode(stylesheet); } </script> </head> <body
> <center>
<!--NAVBAR--> <div class="body"
align="center"> <table cellspacing="0"
cellpadding="0"> <tr> <td
bgcolor="#000000" height="20" width="100"><div class="tnav"
align="center"><strong>Home</strong></div></td> </tr> <tr>
<td bgcolor="#000000" height="20" width="100"><div class="tnav"
align="center"><strong><a
href="news.html">News</a></strong></div></td> </tr> <tr>
<td bgcolor="#000000" height="20" width="100"><div class="tnav"
align="center"><strong><a
href="reviews.html">Reviews</a></strong></div></td> </tr> <tr>
<td bgcolor="#000000" height="20" width="100"><div class="tnav"
align="center"><strong><a href="online/online.html">Play
online</a></strong></div></td> </tr> <tr>
<td bgcolor="#000000" height="20" width="100"><div class="tnav"
align="center"><strong><a href="#">Downloads</a><br
/><br
/></strong></div></td> </tr> <tr>
<td bgcolor="#000000" height="20" width="100"><div class="tnav"
align="center"><strong>
<!-- The parsed XML/XSL should appear
here-->
<div
id="divInfo"></div></strong></div></td> </tr> </table> </center> </body> </html>
topten.xsl
<?xml version="1.0"?> <xsl:stylesheet
version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template
match="/"> <html> <head>
<link rel="stylesheet" href="../style.css" type="text/css"
/> </head> <body topmargin="0"
leftmargin="0" marginheight="0" marginwidth="0">
<xsl:apply-templates/> <div
class="body"><br /> <a href="../games/games.html"
target="_parent"> Visit the forums
TODAY </a></div></body> </html> </xsl:template> <!--
Formatting -->
<xsl:template match="topfive"> <span
class="tnav"><strong>Top
5</strong> </span><br
/> </xsl:template>
<xsl:template match="f1"> <span
class="body"> <a href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="f2"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="f3"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="f4"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="f5"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span><br
/> </xsl:template> <xsl:template
match="newfive"> <span class="tnav"><strong>New
5</strong> </span><br
/> </xsl:template> <xsl:template
match="n1"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="n2"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="n3"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="n4"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template> <xsl:template
match="n5"> <span class="body"> <a
href=" {@location}"><xsl:value-of
select="."/></a> </span> </xsl:template>
</xsl:stylesheet>
topten.xml
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl"
href="main.xsl"?> <home>
<newfive /> <n1 location="http://vr_tech.tripod.com/games/online/ufoattack/index.html"
target="_blank">UFO Attack</n1> <n2 location="http://vr_tech.tripod.com/games/online/3ddriver/index.html"
target="_blank">3D Driver</n2> <n3 location="http://vr_tech.tripod.com/games/online/torpedo/torpedo.html"
target="_blank">Torpedo Alley</n3> <n4 location="http://vr_tech.tripod.com/games/online/jsnake1/snake1.html"
target="_blank">jSnake</n4> <n5 location="http://vr_tech.tripod.com/games/online/break1/break1.html"
target="_blank">BreakOut 1</n5>
</home>
<about name="RCXAU" email="rcxau@y..." question="Why
is the buggiest browser the most widespread" /> <VRtech
motto="Bringing you all things IT (in the near future
:-)" web="http://vrtechau.tripod.com/"
/>
|