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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT/ XML failing in Safari browser only

Status
Not open for further replies.

Dozzer81

Technical User
Jun 29, 2007
14
GB
I thought that safari was a mozilla browser but it seems to be failing to load any of my xslt/xml. My site loads up fine in IE5, IE5.5, IE6, IE7, Firefox, Opera but not in Safari. I'm completely stumped about this. I'm using JavaScript to do the transformation on the client and I don't want to do server side.

Here is my Code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]


<head>
<title>Solana Gallery - Contemporary russian art</title>

<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.async=false;
  xmlDoc.load("artistlist.xml");
  var xsltProc = new XSLTProcessor();
  var xsl=document.implementation.createDocument("","",null);
  xsl.async=false;
  xsl.load("artistlist.xsl");
  xsltProc.importStylesheet(xsl);
  xmlDoc=xsltProc.transformToDocument(xmlDoc);
  var serializer=new XMLSerializer();
  document.write(serializer.serializeToString(xmlDoc));
  }
else
  {
  alert('Your browser cannot handle this script');
  }
}

</script>
</head>

<body>
</body>
</html>

This is quite annoying as my client just bought a Mac and I have to present this on her computer. So any help would be appreciated. thanks.
 
I personally wouldn't encourage and/or provide any excuse to attract those specializing in browser-mega-talk to this forum of xml. Why don't you search what-support-what at safari or some browser forums?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top