Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

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 Codewalkers Forums Sponsor:
  #1  
Old May 23rd, 2003, 09:21 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Using Java to load xml file?

Hello, I hope someone can help me out with this.
I have been searching around the net trying to get some decent java to work in relation to loading an xml news file from another site(by permission of other site), and everything I have been trying isn't working.I don't know very much about java, but this is what I have been working with trying to get a news feed to show up on my html page:
php Code:
Original - php Code
  1. <script language="JavaScript">
  2. function load() {
  3.  var xmlDso=myXML.XMLDocument;
  4.  xmlDso.load("example3.xml");
  5. }
  6. </script>

I know this is supposed to extract contents from an external XML file using XML-DSO.
I know there is more to go with it, but I am at a loss and am not sure how to go about getting it implemented in my pages.

Reply With Quote
  #2  
Old May 23rd, 2003, 09:31 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Using Java to load xml file?

First of all, this is javascript you are referring to, not java (that's a complete different language!)

If you are planning to do this on an online website, forget it and go server-side. Security settings in most IE clients won't allow you to do this! (except when the xml is from the same domain)
However, for an offline page like an active desktop this is very usable; I have built a forum tracker for one of my favorite forums that uses this technique to track topics in an active desktop DHTML application.
This website has been very helpfull to me to implement it and make it also work in Mozilla: http://webfx.eae.net/dhtml/xmlextras/xmlextras.html

Reply With Quote
  #3  
Old May 23rd, 2003, 09:40 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Using Java to load xml file?

Sorry about the mix up, I meant to put JavaScript in the topic name too but didn't for some reason.
I am doing this for an active online site to provide my visitors with a news feed from said other site.The other site has given me all the info I need to collect their xml file, but getting it posted on my page is harder then I thought it would be.
Anyway, thanks for the link.I will check it out and see if they have anything there I can use.

Reply With Quote
  #4  
Old May 24th, 2003, 10:31 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Using Java to load xml file?

Like I said: when the XML is coming from another domain you can't use the javascript XML DOM parser because javascript security doesn't allow you to get information from other domains.
You will have to go server-side

Reply With Quote
  #5  
Old May 24th, 2003, 11:06 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Using Java to load xml file?

by the way; the easiest would be to load the XML serverside and redirect it to the client. That way the feed would come from your domain and you can use the client-side parsing bit:

php Code:
Original - php Code
  1.  
  2. <?php
  3.  
  4. $fp = fopen('http://www.remotesite.com/xmlfeed.xml', 'r');
  5.  
  6. // header('Content-Type: text/xml;charset=iso-8859-15'); if necessary
  7. fpassthru($fp);
  8.  
  9. fclose($fp);
  10.  
  11. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Using Java to load xml file?


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway