| | |
Weather Feed Reader
Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 1
Reputation:
Solved Threads: 0
These days I’ve been working on creating feed reader which retrieves data from weather.com site. They provide detailed SDK and information you’ll need to read information from their site.
I had to use ASP as script language to read XOAP service data. What is interesting a lot of sites provide good information how to read XML from ASP. And all they say the following code should work:
where xmlURL is path to actual XML resource (in case of weather.com it’s xoap.weather.com/weather/… ). But it did not. When I put there local path to XML file on my local drive - it worked perfectly but when I used remote URL - it said kinda “Empty XML resource”. I spent some time investigating this issue and it turned out that I had to use extra parameter in order to get access to remote URL (as far as I understood from the explanation this problem appears due to older XMLDOM versions and probably it won’t ever happen on newer Windows installation). So final working code looks like this:
I hope that was helpfull
I had to use ASP as script language to read XOAP service data. What is interesting a lot of sites provide good information how to read XML from ASP. And all they say the following code should work:
asp Syntax (Toggle Plain Text)
Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.async = False objXML.setProperty "ServerHTTPRequest", true objXML.Load (xmlURL) If objXML.parseError.errorCode <> 0 Then Response.Write objXML.parseError.reason End If
where xmlURL is path to actual XML resource (in case of weather.com it’s xoap.weather.com/weather/… ). But it did not. When I put there local path to XML file on my local drive - it worked perfectly but when I used remote URL - it said kinda “Empty XML resource”. I spent some time investigating this issue and it turned out that I had to use extra parameter in order to get access to remote URL (as far as I understood from the explanation this problem appears due to older XMLDOM versions and probably it won’t ever happen on newer Windows installation). So final working code looks like this:
asp Syntax (Toggle Plain Text)
Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.async = False objXML.setProperty "ServerHTTPRequest", true objXML.Load (xmlURL) If objXML.parseError.errorCode <> 0 Then Response.Write objXML.parseError.reason End If
I hope that was helpfull
![]() |
Similar Threads
- RSS feed reader (PHP)
- Weather updater (Python)
- A RSS feed reader.... (C#)
- The Weather-- Your mood(s)... (Geeks' Lounge)
- My towens weather (Upcoming News Stories)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: JDOM Element problem
- Next Thread: XML Transformations
| Thread Tools | Search this Thread |
api blogger blogging code delete development dynamiccreationofnvariablesinxslt error firstthreecharacterofastringrequired flipbook gdata google html include java link linspire linux microsoft news node openoffice overwrite precedence programming rss standards swf template transform variable w3c web xml xmlnotloading xmlonserver xsl xslt





