Martin wrote:
Hi our server does not have access to the internet, and is failing to
load cXml documents posted to it due to trying to validate the DTD.
I found an example for .net 2.0 using XmlReaderSettings to turn off the
validation, but I'm using .net 1.1.
Here's the current code:
Stream xmlInString = ((Stream)Request.InputStream);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(xmlInString);
..NET 1.x does not validate unless you are using XmlValidatingReader. It
will however load DTDs/external entities. If you don't want that then
you need to set the XmlResolver to null e.g.
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.XmlResolver = null;
xmlDoc.Load(stream);
Try whether that works, if there are any entity references in the XML
where the entities are defined in the external DTD then you will get an
exception.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/