.NET XML Question

Status
Not open for further replies.

SleepDirt

Ars Tribunus Militum
2,000
I'm working on a C# app that parses some local XML info. It works perfectly when connected to the internet but as soon as I am not.. it throws exceptions like a 4 year old child. I am using XmlDocument & XmlNodeList. Is there some terrible restriction to using these for local documents?

Here's the exceptions:

Unhandled Exception: System.Net.WebException: The underlying connection was closed: The remote name could not be resolved.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.Schema.DtdParser.ParseDocTypeDecl()
at System.Xml.Schema.DtdParser.Parse()
 

SleepDirt

Ars Tribunus Militum
2,000
Originally posted by GoofBall:
Hrm, what are you using as the parameter for the Load method? You may have to load the local file into a Stream, then pass that to the Load method of XMLDocument.

Right now I am using:

code:<HR>
Code:
XmlDocument x_config = new XmlDocument();
x_config.Load("page.xml");

I'm going to see if I can figure out how to use a stream from a local file... sounds like it might work.

Thanks
 
Status
Not open for further replies.