Loading XML with missing DTD

M

Morten Nielsen

I'm trying to load an XML file, that references a DTD without a relative
URL. This renders the error: Could not find file
"C:\WINNT\system32\capabilities_1_1_0.dtd".

Here's the XML I'm loading:
http://maps1.intergraph.com/wms/ussample/request.asp?SERVICE=WMS&REQUEST=GetCapabilities
Notice the DTD reference at the second line:
<!DOCTYPE WMT_MS_Capabilities SYSTEM "capabilities_1_1_0.dtd" [

What I try to do:
----------------------------------
WebResponse myResponse = myRequest.GetResponse();
Stream stream = myResponse.GetResponseStream();
XmlDocument doc = new XmlDocument();
doc.Load(stream); // This is where it fails
----------------------------------

The code works fine when no DTD is specified.

Is there some way I can prevent the DTD checking, or make it read the dtd,
which is located relative to the XML file?

Any help is appreciated.

Regards
/Morten Nielsen
Email: http://www.iter.dk/contact.aspx
 

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

Top