Re: HttpRequest Question



See my confirmation at this same thread level.

For now it looks like to me you make a confusion between what you see in the
browser (that is the result of the XSL transformation) and what you really
have (that is the original XML file). Obviously if you stream the response
you get from the server to a browser, the browser will still process the
file and display it as if it were transformed. If your program process the
result, it will see though this content as the raw XML document and not
something transformed.

What do you want to do on this XML file ? If you want to process this in
your code, you IMO already have the "raw" XML file. If you want to just
display it as an untransformed file in the browser you could just suppress
the style*** tag.

---
Patrice

"Anthony Sullivan" <anthony@xxxxxxxxxxxxxxxxxxx> a écrit dans le message de
news: uLoOA2UcHHA.4976@xxxxxxxxxxxxxxxxxxxxxxx
When I browse in IE to the site and hit 'View Source' I see the raw un
transformed xml.

When the browser processes the file it downloads the xsl and transforms it
for viewing.

What I'd like to do is grab the raw xml source. Its obviously available
somewhere of I wouldn't see it when I 'view source'.

Any ideas?

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

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
style*** 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





.