ds.ReaXml(); in portuguese ???

Hi,

I'm trying to read this XML(http://www.wunderground.com/auto/rss_full/global/stations/83780.xml units=both )in portuguese is there a way to do that (Web Application)

When I open it in IE I read it in portuguese, but when I query it through .net it returns in english...

Thanks




Answer this question

ds.ReaXml(); in portuguese ???

  • Dietz

    You may need to modify the Headers and ensure that the language that is sent to the website is portugal. A quick way to verify this is to packet sniff both sessions and see if your web browser is sending the language header for portugal.

  • jdevito

    But how do I do that

    Like this <meta http-equiv="Content-Language" content="pt-br" />



  • ks2006

    And it get's the URL for you. Wow I did not know the DataSet would navigate the HTTP protocol. Well that is your problem then. You'll need to use something like the WebCient. Thankfully - this isn't too difficult. I will try to post some code in a bit hopeuflly.

  • John Cogan

    I'm using just this...

    DataTable dados;

    public Forecast(string url_rss)

    {

    DataSet ds=new DataSet();

    ds.ReadXml(url_rss, XmlReadMode.Auto);

    dados=ds.Tables["item"];

    }



  • bilalso

    WebClient Webbie = new WebClient();
    String Url = "http://www.wunderground.com/auto/rss_full/global/stations/83780.xml units=both";
    Webbie.Headers.Add("Content-Language", "pt-br"); // I don't know if this is the right header as I didn't packet sniff . but this shows how to set it.
    Stream Streams = Webbie.OpenRead(Url);
    DataSet Dessie = new DataSet();
    Dessie.ReadXml(Streams);

    Here is the code. The code "works". I just dont know if it returns the Portugues version you want it

  • Bwilhite

    You probably need to use an analyzer or use a plugin for mozilla that lets you snoop at the http headers that are sent/received and see what a request from a browser looks like and then emulate that request appending the appropriate headers.

  • Jeanvo

    Your web request that you are using to get it should have a Headers property. You should add it to there. This may vary depending upon what class you are using to retrieve the file. You should post the related code or mention the class(es) you are using

  • Rafet

    I'm gonna test it, reply in a while..

    Thanks



  • dgolds

    hunft, that code didn't worked it continues to get the data in english..

    But it's ok, I'm using replace and tranlating the data...

    Thanks anyway



  • ds.ReaXml(); in portuguese ???