I'm completely new to XML and am having a major problem trying to display the content in non IE browsers. I have tried various methods including server side which doesn't work at all for me. I think its the javascript but unfortunately I understand html and css a lot better than xml,xslt and javascript.
I would appreciate any help as I'm completely stuck on this, I have followed the tutorials at w3cschools and think the XSLT and XML is correct.I have supplied the code for my XML, XSLT and javascript below. This works in IE but not in any other browser.
<<<<<<<<<<<<<<< My XML: >>>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="ISO-8859-1"?>
<artistlist>
<artist>
<name>Dorian Piaskowski</name>
<address>piaskowski-d.html</address>
</artist>
<artist>
<name>Tom Piaskowski</name>
<address>piaskowski-t.html</address>
</artist>
</artistlist>
<<<<<<<<<<<<<<<< MY XSLT: >>>>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>Solana Gallery - Contemporary russian art</title>
<link href="gallery.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logo"><a href="index.html"><img src="images/Small_Solana-Logo.png" alt="Solana Gallery Logo" /></a></div>
<div class="container">
<h2>Artist List</h2>
<h3>Title</h3>
<ul class="clientlist">
<xsl:for-each select="artistlist/artist">
<li>
<a href="{address}"><p><xsl:value-of select="name"/></p></a> </li>
</xsl:for-each>
</ul>
</div>
<div class="nav">
<ul>
<li><a href="index.html">Home</a></li>
</ul>
<ul>
<li><a href="artistlist.html">Artists</a></li>
</ul>
<ul>
<li><a>Exhibitions</a>
<ul>
<li><a>Recent</a></li>
<li><a>Future</a></li>
<li><a href="past.html">Past</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href="contactus.html">Contact Us</a></li>
</ul>
<ul>
<li><a>About Us</a>
<ul>
<li><a href="whoweare.html">Who We Are</a></li>
<li><a href="artservices.html">Art Services</a></li>
<li><a href="clients.html">Clients</a></li>
<li><a href="news.html">News</a></li>
</ul>
</li>
</ul>
</div>
<!-- end the menuh div -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<<<<<<<<<<<<<<< MY HTML: >>>>>>>>>>>>>>>>>>
<html>
<body>
<script type="text/javascript">
var xmlDoc;
{
// code for IE
if (window.ActiveXObject)
{
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async=false;
xml.load("artistlist.xml");
// Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
xsl.load("artistlist.xsl");
// Transform
document.write(xml.transformNode(xsl))
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation &&
document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("artistlist.xml");
}
else
{
alert('Your browser cannot handle this script');
}
}
</script>
</body>
</html>
I would appreciate any help as I'm completely stuck on this, I have followed the tutorials at w3cschools and think the XSLT and XML is correct.I have supplied the code for my XML, XSLT and javascript below. This works in IE but not in any other browser.
<<<<<<<<<<<<<<< My XML: >>>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="ISO-8859-1"?>
<artistlist>
<artist>
<name>Dorian Piaskowski</name>
<address>piaskowski-d.html</address>
</artist>
<artist>
<name>Tom Piaskowski</name>
<address>piaskowski-t.html</address>
</artist>
</artistlist>
<<<<<<<<<<<<<<<< MY XSLT: >>>>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>Solana Gallery - Contemporary russian art</title>
<link href="gallery.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logo"><a href="index.html"><img src="images/Small_Solana-Logo.png" alt="Solana Gallery Logo" /></a></div>
<div class="container">
<h2>Artist List</h2>
<h3>Title</h3>
<ul class="clientlist">
<xsl:for-each select="artistlist/artist">
<li>
<a href="{address}"><p><xsl:value-of select="name"/></p></a> </li>
</xsl:for-each>
</ul>
</div>
<div class="nav">
<ul>
<li><a href="index.html">Home</a></li>
</ul>
<ul>
<li><a href="artistlist.html">Artists</a></li>
</ul>
<ul>
<li><a>Exhibitions</a>
<ul>
<li><a>Recent</a></li>
<li><a>Future</a></li>
<li><a href="past.html">Past</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href="contactus.html">Contact Us</a></li>
</ul>
<ul>
<li><a>About Us</a>
<ul>
<li><a href="whoweare.html">Who We Are</a></li>
<li><a href="artservices.html">Art Services</a></li>
<li><a href="clients.html">Clients</a></li>
<li><a href="news.html">News</a></li>
</ul>
</li>
</ul>
</div>
<!-- end the menuh div -->
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<<<<<<<<<<<<<<< MY HTML: >>>>>>>>>>>>>>>>>>
<html>
<body>
<script type="text/javascript">
var xmlDoc;
{
// code for IE
if (window.ActiveXObject)
{
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async=false;
xml.load("artistlist.xml");
// Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
xsl.load("artistlist.xsl");
// Transform
document.write(xml.transformNode(xsl))
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation &&
document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("artistlist.xml");
}
else
{
alert('Your browser cannot handle this script');
}
}
</script>
</body>
</html>