XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 14th, 2004, 05:10 PM
sloerentetsen sloerentetsen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 10 sloerentetsen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
displaying xml with javascript doesn't work in netscape

Hi,

For some reason my xml + xsl isn't showing in netscape (any version). I display the xml with javascript.
Here's the page: http://www.aikikai.be/ssk/stages.htm
Here's the code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Stagelijst</title>
<link href="StageInfo.css" type="text/css" rel="stylesheet">
<!--<link href="../renshin.css" type="text/css" rel="stylesheet">-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body bgcolor="#B8D0DC">
<center>
<b><font color="#CC0000" size="5">Aikido Stage Kalender</font></b>
<p>bijgehouden door <a href="http://www.aikikai.be/ssk" target="_parent">Shu Shin Kan</a></p>

</center>

<div id=XMLStages></div>

<script language="JavaScript">

var xmlDoc;
var xslDoc;
var stagelayer;

xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async = false;

xslDoc = new ActiveXObject('Microsoft.XMLDOM');
xslDoc.async = false;

xmlDoc.load("stages.xml");

xslDoc.load("stagesXSL.xml");

if(document.layers){
//thisbrowser="NN4";
stagelayer = document.layers["XMLStages"];
stagelayer.document.open();
stagelayer.document.write(xmlDoc.documentElement.transformNode(xslDoc));
stagelayer.document.close();
} else if(document.all){
//thisbrowser="ie"
stagelayer = document.all["XMLStages"];
stagelayer.innerHTML = xmlDoc.documentElement.transformNode(xslDoc);
} else if(!document.all && document.getElementById){
//thisbrowser="NN6";
stagelayer = document.getElementById("XMLStages");
stagelayer.innerHTML = xmlDoc.documentElement.transformNode(xslDoc);
}

</script>

</body>
</html>

Thanks for any and all help

ST

Reply With Quote
  #2  
Old June 15th, 2004, 02:09 PM
sloerentetsen sloerentetsen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 10 sloerentetsen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, so the reason it's not showing is because Netscape doesn't support ActiveXObject.
So, THE solution is sarissa (http://sarissa.sourceforge.net/).
Netscape still isn't showing anything though.
Here's the script

// get the source document
var oDomDoc = Sarissa.getDomDocument();
oDomDoc.async = false;
oDomDoc.load("stages/stages.xml");

// get the stylesheet document
var oXslDoc = Sarissa.getDomDocument();
oXslDoc.async = false;
oXslDoc.load("stages/stagesXSL.xml");

// transform and store the results to a string
var sResult = oDomDoc.transformNode(oXslDoc);
document.getElementById("XMLStages").innerHTML = sResult;

XMLStages is a layer (DIV)

Hey Mr wizzard, need a little help please. And don't tell me there is no spoon!

ST

Reply With Quote
  #3  
Old June 16th, 2004, 06:05 PM
FragMaster B's Avatar
FragMaster B FragMaster B is offline
NINJA! ...on fire no less
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Rockies
Posts: 188 FragMaster B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 13 m 12 sec
Reputation Power: 6
I use this bit of script to load an XML doc into Netscape 7+...

Quote:
xmlDoc= document.implementation.createDocument("","doc",null);
xmlDoc.load(XMLfilename + ".xml");
xmlDoc.onload=XML_Loaded //Detect complete loading of XML file (NS only)


This page has a nice little sample for when you need to support both IE and Mozilla...

http://www.quirksmode.org/dom/importxml.html

Reply With Quote
  #4  
Old June 16th, 2004, 06:22 PM
FragMaster B's Avatar
FragMaster B FragMaster B is offline
NINJA! ...on fire no less
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Rockies
Posts: 188 FragMaster B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 13 m 12 sec
Reputation Power: 6
Wanna make your life REAL easy? Check this...

http://www.howtocreate.co.uk/jslibs.../importxml.html

I'm gonna beat it around a little and see how good it really is.

Reply With Quote
  #5  
Old June 17th, 2004, 08:27 AM
sloerentetsen sloerentetsen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 10 sloerentetsen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks!!
This sure helps a lot!

ST

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > displaying xml with javascript doesn't work in netscape


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT