homepage Welcome to WebmasterWorld Guest from 54.197.215.146
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Loading External XML file: works server-side, but not client-side
yisraelharris




msg:701957
 6:27 pm on Aug 23, 2004 (gmt 0)

I have to display a Yahoo! news feed on a webpage. This URL tells how to do it: [elise.com...]

The logic is simple, and it works great:
1. Create an object and load your xsl file (which I created)
2. Create an object and load your xml file (the Yahoo! news feed)
3. Use the "transformNode" method for your output.

Trouble is, it uses ASP, and I must use html. I tried to 'convert' the ASP code into clientside javascript, and it works fine -- on my computer. But then when I upload the html file to my server and run it, I get "access denied" on the line that tries to open the Yahoo! feed. The code is below.

I tried the following variations, but none of them solved the problem:
1. Instead of Microsoft.XMLDOM, Msxml2.DOMDocument
2. Instead of Microsoft.XMLDOM, Msxml2.DOMDocument.4.0
3. The command: xmldoc.setProperty("ServerHTTPRequest", true)

Now you have the complete context, but what it really boils down to is loading an external xml file from clientside javascript. Maybe it is not possible?

Any solutions would be very welcome. Thank you.

Here is the code:

<html>
<body></body>
<script>
xsldoc = new ActiveXObject("Microsoft.XMLDOM")
xsldoc.async = false
xsldoc.load("rss.xsl")
xmldoc = new ActiveXObject("Microsoft.XMLDOM")
xmldoc.async = false
xmldoc.load("http://rss.news.yahoo.com/rss/mideast")<!--HERE IS THE PROBLEM-->
document.write(xmldoc.transformNode(xsldoc))
</script>
</html>

 

macrost




msg:701958
 8:53 pm on Aug 24, 2004 (gmt 0)

Instead of just the load method, try the loadXml method:
xmldoc.load("http://rss.news.yahoo.com/rss/mideast")

xmldoc.loadXml("http://rss.news.yahoo.com/rss/mideast")

yisraelharris




msg:701959
 9:08 pm on Aug 24, 2004 (gmt 0)

Thank you for the suggestion.

I was told on another forum that what I want to do is simply not allowed, and it kind of makes sense to me.

I was told of a totally different way to get the job done: feedroll.com. It works quite nicely.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved