Connecting Tech Pros Worldwide Help | Site Map

Valid xml to read from an xml file?

Chumley Walrus
Guest
 
Posts: n/a
#1: Dec 28 '05
I'm using vb.net, i get an error at the reader line saying the remote
server can't be found. Is the below even valid?

dim reader as XmlTextReader
reader = new XmlTextReader ("http://www.mysite.com/my.xml")
do while (reader.Read())
'do some action here
response.write(reader)
loop


thanx
chumley

Chris Lovett
Guest
 
Posts: n/a
#2: Dec 28 '05

re: Valid xml to read from an xml file?


XmlTextReader uses System.Net.WebRequest under the covers -- see if you can
figure out how to create a connection that way. Usually there's some proxy
server information missing that you can enable if you use WebRequest
directly, and then pass the result of GetResponse().GetResponseStream() to
the constructor of XmlTextReader.

"Chumley Walrus" <springb2k@yahoo.com> wrote in message
news:1135805420.732543.172730@g49g2000cwa.googlegr oups.com...[color=blue]
> I'm using vb.net, i get an error at the reader line saying the remote
> server can't be found. Is the below even valid?
>
> dim reader as XmlTextReader
> reader = new XmlTextReader ("http://www.mysite.com/my.xml")
> do while (reader.Read())
> 'do some action here
> response.write(reader)
> loop
>
>
> thanx
> chumley
>
>[/color]


Peter Rilling
Guest
 
Posts: n/a
#3: Dec 28 '05

re: Valid xml to read from an xml file?


You might try using XmlDocument.Load(...). Looks like you can pass a string
url as the parameter.

"Chumley Walrus" <springb2k@yahoo.com> wrote in message
news:1135805420.732543.172730@g49g2000cwa.googlegr oups.com...[color=blue]
> I'm using vb.net, i get an error at the reader line saying the remote
> server can't be found. Is the below even valid?
>
> dim reader as XmlTextReader
> reader = new XmlTextReader ("http://www.mysite.com/my.xml")
> do while (reader.Read())
> 'do some action here
> response.write(reader)
> loop
>
>
> thanx
> chumley
>[/color]


Closed Thread