Cross-browser XML parsing???

This is a discussion on "Cross-browser XML parsing???" within the Other Programming Languages section. This forum, and the thread "Cross-browser XML parsing??? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 28th, 2005, 03:20
Junior Member
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Cross-browser XML parsing???

Hi everybody. I was just reading at XML parsing using JavaScript/DOM when I noticed that everything I saw created an ActiveX object to parse it. This of course means that it isn't compatible with Firefox, Netscape, etc.

I was wondering if there is a cross-browser method to do this using JavaScript because server-side scripting is not available yet.

Thanks!

Edit: Sorry if this is in the wrong forum. It relates to both XML and JavaScript, but I figured XML DOM would be the best choice.
Reply With Quote

  #2 (permalink)  
Old Mar 28th, 2005, 08:47
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
It's not always possible to post in the correct forum, so don't worry about it too much!

In most situations, XML should be parsed on the server side. I can't think of a good reason for it not to be, other than you simply don't have that feature available.

As for why most of the ones you saw used an ActiveX object - I can only assume that was done for speed.

However, there is this site which appears to offer exactly what you want - and it's cross browser.

But what if the user disables Javascript in their browser? What will you do then?
Reply With Quote
  #3 (permalink)  
Old Mar 28th, 2005, 16:06
Junior Member
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks, Karl. I was hoping for something I could actually code myself, though. I found something to load the XML file, but now I need to figure out how to pull information from the file.

By the way, here is the JS solution I found for loading an XML file:

Code: Select all
<script language="javascript">

var xmlDoc;

function Netscape()
{
 var meeting,text;
 meeting = xmlDoc.getElementsByTagName('meeting_title');
 text = meeting[0].firstChild.nodeValue;
 alert(text);
 
}

function readXmlDocument()
{
 
if(window.ActiveXObject)
{
 //xmlWinDoc = document.getElementById('meetingsxml').XMLDocument;
 xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
 xmlDoc.load('meetings.xml');
 
 }
if(document.implementation && document.implementation.createDocument)
 {
  xmlDoc = document.implementation.createDocument("","",null);
  xmlDoc.onload = Netscape;
  xmlDoc.load('meetings.xml');
 }
 
}
</script>
It worked for me, but now I need to insert the information into an X/HTML page. I'm hoping it doesn't require JS or XSLT, but some things just can't be avoided. :P
Reply With Quote
  #4 (permalink)  
Old Mar 28th, 2005, 17:34
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by gohankid77
Thanks, Rob.
I'm not Rob :P
Reply With Quote
  #5 (permalink)  
Old Mar 28th, 2005, 17:39
Junior Member
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
*fixed* Sorry about that... :P
Reply With Quote
Reply

Tags
crossbrowser, xml, parsing

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
cross browser issues planescape Web Page Design 4 Aug 29th, 2007 21:16
Cross Browser issues. Destx Web Page Design 5 Mar 26th, 2007 18:56
Cross-Browser difficulties... Dapandyman Web Page Design 6 Dec 9th, 2006 20:53
New Cross-Browser Low masonbarge JavaScript Forum 2 May 11th, 2006 17:18
Cross Browser jwalker80 Web Page Design 10 Dec 22nd, 2005 14:38


All times are GMT. The time now is 21:51.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43