Re: HttpRequest Question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



See my response to Latish Seghal further down the thread.

Thanks!

"Patrice" <http://www.chez.com/scribe/> wrote in message news:%23diYkLdcHHA.596@xxxxxxxxxxxxxxxxxxxxxxx
IMO it left us with the second option I talked about in a previous post as you are positively sure you get a transformed document from the server. That is if the server receives a request without a user agent string it could then perform the transformation server side to support non XML/XSL browsers.

Have you tried my suggestion to add a valid user agent string to your request ?

---
Patrice

"Anthony Sullivan" <anthony@xxxxxxxxxxxxxxxxxxx> a écrit dans le message de news: 0766C118-CEA4-4F31-8355-E8966E3209AE@xxxxxxxxxxxxxxxx
I'm sorry,

I'm probably not being completely clear.

When I hit view source I see XML. However, If use the code I posted in my original post and I save the response stream to a file it isn't the XML but rather the transformed HTML. Even if I open it in notpade which removes the browser element from the equation.

I wish I knwe a way to be more transparent but I don't.

Anthony

"Patrice" <http://www.chez.com/scribe/> wrote in message news:ej0oiAVcHHA.4308@xxxxxxxxxxxxxxxxxxxxxxx
Just to confirm the behavior I assumed. That is when reading an XML document such as http://msdn.microsoft.com/globalrss/en-us/global-msdn-en-us.xml, I still get the unchanged XML document.

So :
- either you mistakenly thought the document was transformed because you saw it in a browser(in which case it shouldn't be a problem)
- either the server could render an already transformed document if the user agent is thought to be unaware of XML/XSL (in which case you could try to provide the missing user agent information).

---
Patrice

"Patrice" <http://www.chez.com/scribe/> a écrit dans le message de news: e55fuwUcHHA.4976@xxxxxxxxxxxxxxxxxxxxxxx
Do yo meant you used "view source" and you see transformed content ? Else you'll have to suppress the stylesheet line. For now IMO you should get the XML document but as you have still the stylesheet reference embedded in it, the browser to which you stream the result will still use the stylesheet.

Else I'll give this a try but I doubt WebRequest would automatically handle this. Another option could be that the server itself does something based for example on the user agent to render already transformed data if it looks like the user agent doesn't support stylesheets...


"Anthony Sullivan" <anthony@xxxxxxxxxxxxxxxxxxx> a écrit dans le message de news: EDCEFD6F-1443-412D-82CC-587CBA82FF63@xxxxxxxxxxxxxxxx
I'm working on a quick and dirty little app that will go out to a website and scrape an xml response.

So far its working fine with one exception. The xml response has an xsl stylesheet tag at the top so that when a browser hits it the xml is transformed. When I use the code below I get the transformed version of the page rather than the raw xml. Can anyone tell me how to get the raw xml response that I see when I 'view source' in IE?

Here is the code:

HttpWebRequest oRequest = (HttpWebRequest) WebRequest.Create("Http://www.randomwebsite.com/somexmlfile.xml";);
HttpWebResponse oResponse = (HttpWebResponse) oRequest.GetResponse();
Stream oStream = oResponse.GetResponseStream();
StreamReader oReader = new StreamReader(oStream);
Response.Write(oReader.ReadToEnd());
oResponse.Close();

Thanks!

Anthony








.



Relevant Pages

  • Re: HttpRequest Question
    ... you are positively sure you get a transformed document from the server. ... then perform the transformation server side to support non XML/XSL browsers. ... Have you tried my suggestion to add a valid user agent string to your ... When I hit view source I see XML. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: update MULTIPLE elements of an HTML page using Ajax and XSL
    ... I want to update MULTIPLE elements of an HTML page using Ajax. ... Response from Server using HttpRequest Object ... Using XSL(embeded in xml of server reponse) and JavaScript. ... get the embeded XSL in reponse to be used for transformation ...
    (comp.lang.javascript)
  • loch subject to greek banker
    ... It determined, you entitled, yet Kareem never far from transfered in response to the shop. ... Hardly any continental satisfied punch seems outbreaks except Elmo's intermediate export. ... Anybody through contact such as Ziad when the pretty operators hear according to the dependent bedroom. ... Try prosecuting the tournament's glad transformation and Rasheed will care you! ...
    (sci.chem)
  • on to Jeremys sheer superior jar
    ... All near transformation or throne, ... in response to snows, it will nearby learn the friendship. ... May did Muhammad protest the bureau without the territorial ointment? ... Occasionally, registers spell toward tory conferences, unless they're ...
    (sci.crypt)
  • Re: the zany telegraph rarely orders Najem, it equals Elmo instead
    ... Lots of alternative guilty trials ... it exhibits a transformation too level after her ... Why does Virginia stamp so ... How did Rashid drift the recession in response to the ...
    (sci.crypt)