Go Back   SitePoint Forums > Forum Index > Program Your Site > XML and Web Services
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Dec 2, 2007, 10:17   #1
bals28mjk
SitePoint Addict
 
bals28mjk's Avatar
 
Join Date: Aug 2007
Posts: 377
XML and RSS

How can I read an XML file (for RSS for example) from the client?

Thanks!
bals28mjk is offline   Reply With Quote
Old Dec 2, 2007, 11:42   #2
wwb_99
Community Advisor
SitePoint Award Recipient
 
wwb_99's Avatar
 
Join Date: May 2003
Location: Washington, DC
Posts: 9,129
Generally, you will have to use some sort of XML parser. What exactly is "the client"?
wwb_99 is offline   Reply With Quote
Old Dec 2, 2007, 12:21   #3
bals28mjk
SitePoint Addict
 
bals28mjk's Avatar
 
Join Date: Aug 2007
Posts: 377
The thing is the xml file isn't relative to a server. I making the request from my desktop and my permission is denied (for security purposes I naturally assume) so how do apps like newsgator get their permissions to be allowed?

Thanks for the help btw..
bals28mjk is offline   Reply With Quote
Old Dec 2, 2007, 12:25   #4
stymiee
He's No Good To Me Dead
 
stymiee's Avatar
 
Join Date: Feb 2003
Location: Slave I
Posts: 24,090
You should ask the client if they have any sort of security or permission based system in place that you need to be aware of. Otherwise they may just be experiencing an error or maybe you are, too. I suspect there is an error in your software or code.
stymiee is offline   Reply With Quote
Old Dec 2, 2007, 13:09   #5
bals28mjk
SitePoint Addict
 
bals28mjk's Avatar
 
Join Date: Aug 2007
Posts: 377
Lol stymiee the client is me. I, being that client, am trying to access an xml file to play around with the rss. I really want to say it's a syntax error, the only thing is I'm able to parse xml files locally, if I try to grab an XML file from a website though I get a permission error.

Error is this in ff: uncaught exception: Permission denied to call XMLDocument.load.

Apps like newsgator don't have a problems accessing xml files, how can I do the same?
bals28mjk is offline   Reply With Quote
Old Dec 2, 2007, 17:27   #6
stymiee
He's No Good To Me Dead
 
stymiee's Avatar
 
Join Date: Feb 2003
Location: Slave I
Posts: 24,090
That's pretty odd. Sounds more like a FF issue then an issue on your end. What's the URL of the feed?
stymiee is offline   Reply With Quote
Old Dec 2, 2007, 18:34   #7
wwb_99
Community Advisor
SitePoint Award Recipient
 
wwb_99's Avatar
 
Join Date: May 2003
Location: Washington, DC
Posts: 9,129
By "exactly what is the client" I mean "exactly what is the client application", not who is trying to load stuff. Are you building a browser-based tool, or a desktop tool, or what? And what exactly is the permission error while we are at it.
wwb_99 is offline   Reply With Quote
Old Dec 3, 2007, 07:44   #8
kgun
SitePoint Addict
 
Join Date: Nov 2005
Location: Moss, Norway.
Posts: 274
  1. Are you looking for a newsaggregator for a desktop application, then Google: newsaggregator applicationname
  2. How do apps like newsgator get their permissions to be allowed? Via their webservers of course. You make your own in a few minutes using XAMPP, though you should be aware of the security risks involved. Then you may need to compile some additional modules and set permission.
  3. As stated in the first answer there are a lot of XML parsers, like XSL, SimplXML, DOM where DOM is the most advanced.
  4. Yous should also be aware of the XSLT extension EXSLT.
  5. Importing XML documents into XSLT stylesheets for further transformation are done with the XSLT document function. You can also import XML documents using XInclude. That is safer, since you can use xi:fallback to halt processing if the external server is down or the link broken.
  6. There are many methods to transform RSS (XML) files, eg. by using the PHP XSL extension, SOAP etc. etc.
Google the relevant KW's like XAMPP and EXSLT etc.

Related sitepoint link:
http://www.sitepoint.com/forums/showthread.php?t=494736
kgun is offline   Reply With Quote
Old Dec 3, 2007, 11:32   #9
bals28mjk
SitePoint Addict
 
bals28mjk's Avatar
 
Join Date: Aug 2007
Posts: 377
Quote:
Originally Posted by stymiee
That's pretty odd. Sounds more like a FF issue then an issue on your end.
Good idea, first tested in in opera/ff with no luck, seems to be good in ie though. You wouldn't know off hand how to change the config file for that (opera and/or ff) would you?
Quote:
Originally Posted by =wwb_99
By "exactly what is the client" I mean "exactly what is the client application", not who is trying to load stuff. Are you building a browser-based tool, or a desktop tool, or what? And what exactly is the permission error while we are at it.
Oh ok. It's browser based, you must have over looked where I mentioned the error.
Quote:
Originally Posted by bals28mjk
Error is this in ff: uncaught exception: Permission denied to call XMLDocument.load.
Quote:
Originally Posted by kgun
Then you may need to compile some additional modules and set permission.
I already have Apache configured with everything.

I was going to try to change configuration for each browser, I could do this with my web server too?

Thanks guys, you've all been awesome.
bals28mjk is offline   Reply With Quote
Old Dec 3, 2007, 12:03   #10
wwb_99
Community Advisor
SitePoint Award Recipient
 
wwb_99's Avatar
 
Join Date: May 2003
Location: Washington, DC
Posts: 9,129
Ah, I thing I did miss that.

Basically, the issue is that XmlHttp requests cannot be made to a different domain for security reasons. This is actually a very good thing.

What you need to do, as kgun indicates, is to setup a server-side script to proxy the feed to your site, then use XmlHttp to access things locally.

The other option would be to just write a thick-client rather than a browser-based program to handle this stuff.
wwb_99 is offline   Reply With Quote
Old Dec 3, 2007, 14:10   #11
bals28mjk
SitePoint Addict
 
bals28mjk's Avatar
 
Join Date: Aug 2007
Posts: 377
Quote:
Originally Posted by wwb_99
What you need to do, as kgun indicates, is to setup a server-side script to proxy the feed to your site, then use XmlHttp to access things locally.
Hmm, so how do you get the data back into an xml file format?
bals28mjk is offline   Reply With Quote
Old Dec 3, 2007, 21:57   #12
bals28mjk
SitePoint Addict
 
bals28mjk's Avatar
 
Join Date: Aug 2007
Posts: 377
I just ended up writing a file for it.

It works great. Again, wwb_99, stymiee, and kgun thank you.
bals28mjk is offline   Reply With Quote
Old Dec 4, 2007, 23:40   #13
shakir
Non-Member
 
Join Date: Nov 2007
Posts: 433
xml=new ActiveXObject("Microsoft.XMLDOM");
xml.async=false;
xml.load("xx.xml");
now its can display or append anything you can do from client side
shakir is offline   Reply With Quote
Old Dec 5, 2007, 05:52   #14
wwb_99
Community Advisor
SitePoint Award Recipient
 
wwb_99's Avatar
 
Join Date: May 2003
Location: Washington, DC
Posts: 9,129
Let me know how well that works in anything but Internet Explorer.
wwb_99 is offline   Reply With Quote
Old Dec 5, 2007, 06:27   #15
kgun
SitePoint Addict
 
Join Date: Nov 2005
Location: Moss, Norway.
Posts: 274
The worst browser on the internet, and should have been forbidden. They follow their own standards, especially regarding DOM scripting that is a very important part of web applications like AJAX. IE should have been banned until MS start to follow the http://www.w3.org/ standards. Creating a science of the web http://webscience.org/ is not always easy.

Worst of all, new computers come with IE preinstalled. MS is best on operating systems and office solutions in my view.

KW' search:
CSS hacks Internet explorer
Java Script problems with internet explorer.

Writing DOM event listeners according to the W3C DOM 2 specification is extremely simple. The Internet Explorer version is a night mare in comparison. I am an economist. These lack of standards has costed the world billions of USD in loss of efficiency, lack of usability and accessibility.

Browser security. There are no more secure web browser than Opera as far as I know. Security zones in IE is not secure at all. It is false security. If you talk about web security, I can not simply take you as a surfer seriously if you do not use a secure browser. Did you say that you was attacked by cross browser scripting or your bank account was hacked. First question, which browser did you use?

May be Google will soon come up with the best web browser?

Google can start from scratch and follow the web standards set by W3c from the very beginning. A web page as a web browser sees it is a bitstream. The clue is how that bitstream is deciphered by the browser.

Make it simple, as simple as possible but no simpler.

Until the opposite is proved, that is following the web standards IMO

Your disable friend may thank you if you teach him to use Opera. Down load it and clik on view +

Of course, http://widgets.opera.com/ Opera also have their widgets.

Is there a better browser for mobile devices to get a kick start on the mobile revolution?

I am from Norway, so I am not prejudice free, but I am not related to Opera.
kgun is offline   Reply With Quote
Old Dec 5, 2007, 06:36   #16
wwb_99
Community Advisor
SitePoint Award Recipient
 
wwb_99's Avatar
 
Join Date: May 2003
Location: Washington, DC
Posts: 9,129
While IE does have its issue, let us not forget that Microsoft invented AJAX and implemented long before Mozilla was a pipe dream by some netscape engineers.
wwb_99 is offline   Reply With Quote
Old Dec 5, 2007, 07:01   #17
kgun
SitePoint Addict
 
Join Date: Nov 2005
Location: Moss, Norway.
Posts: 274
But they did not invent http://info.cern.ch/ the web or object oriented programming http://www.cetus-links.org/oo_simula.html more specifically here http://heim.ifi.uio.no/~kristen/FORS..._OO_start.html and wasn't this the formal http://www.adaptivepath.com/ideas/es...ves/000385.php start of AJAX.

I have heard the following, but do not know if it is true. You may call Microsoft about problems with IE. You may get the following answer:

"Deinstall it and install another browser".

My advice was for surfers with and without disabilities and especially for mobile surfers in Asia and Africa. Web masters must of course develope their page for IE. Here is one of my favourites:

http://www.equalityhumanrights.com/e...s/default.aspx

Much of that usability and accessibility is already there in Opera.
kgun is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
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
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 22:37.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved