XML Web Control

J

Jason

I have a URL to a site (outside of my domain) that returns me back xml. I
would like to use the XML Web Control to display the content on my web page.
I can do it if I save the XML data to a file on my machine and reference the
source locally.

How can I do this without saving the file to my machine first?

Thanks
 
P

Philip Q [MVP]

This is possible, but it's incredibly complicated to create the stream to
retrieve the file and load the data. It's far easier to continue with what
you are doing and save a copy of the file on your machine (it could also
increase performance if you intelligently cache the file).
 
J

Jason

How complicated could it be?

Philip Q said:
This is possible, but it's incredibly complicated to create the stream to
retrieve the file and load the data. It's far easier to continue with what
you are doing and save a copy of the file on your machine (it could also
increase performance if you intelligently cache the file).

--
Philip Q
Microsoft MVP [ASP.NET]

Jason said:
I have a URL to a site (outside of my domain) that returns me back xml. I
would like to use the XML Web Control to display the content on my web
page.
I can do it if I save the XML data to a file on my machine and reference
the
source locally.

How can I do this without saving the file to my machine first?

Thanks
 
P

Philip Q [MVP]

Well, from what I can see, the Xml control's Document property can take an
XmlDocument, which you can Load with a Stream from an a WebResponse formed
by a WebRequest.

So, it'd probably look something like -

myXml.Document = (new
XmlDocument()).Load(WebRequest.Create("http://localhost/some.xml").GetResponse().GetResponseStream()));

(My syntax is probably a bit wrong).

--
Philip Q
Microsoft MVP [ASP.NET]

Jason said:
How complicated could it be?

Philip Q said:
This is possible, but it's incredibly complicated to create the stream to
retrieve the file and load the data. It's far easier to continue with
what
you are doing and save a copy of the file on your machine (it could also
increase performance if you intelligently cache the file).

--
Philip Q
Microsoft MVP [ASP.NET]

Jason said:
I have a URL to a site (outside of my domain) that returns me back xml.
I
would like to use the XML Web Control to display the content on my web
page.
I can do it if I save the XML data to a file on my machine and
reference
the
source locally.

How can I do this without saving the file to my machine first?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,132
Latest member
TeresaWcq1
Top