Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi Please help me
if you have an xml contents(or file ie yahoo weather service result)
,how to load it as a web page not xml contents in web browser in c# windows application
thanks.
Posted

Have you examined closely the XML result of a Yahoo Weather RSS feed in response to a query ?

For example: [^]

You will see that the XML includes a link to an HTML representation in the Yahoo format. Look at the <link> node under the Item sub-node under the root-node "Channel:"
XML
<item>
  <title>Conditions for Sunnyvale, CA at 9:38 am PST</title>
  <geo:lat>37.37</geo:lat>
  <geo:long>-122.04</geo:long>
  <link>http://us.rd.yahoo.com/dailynews/rss/weather/Sunnyvale__CA/*http://weather.yahoo.com/forecast/USCA1116_f.html</link>
So parse the XML (either via the DOM, or just plain old file-searching, or string searching), extract the HTML link, do a "get" on that link, and then re-use the HTML returned.

Now, if your purpose is to extract the data in a Yahoo Weather RSS XML response, and present it in your own HTML format: that's another problem. For that, you can either construct your own XSLT transform, or parse the file yourself, extracting what you need, and generating custom HTML.

In either case you should follow the Yahoo guidelines for attribution, found in the first link given in this answer under "Terms of Service."
 
Share this answer
 
v2
Web pages are using HTML. You can use XSLT to transform XML in HTML then load the HTML.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900