Search code examples
.netxmlgacdtdresolve

How to resolve local DTDs without System.Xml.Utils.Dll(XmlPreloadedResolver)?


I use an external DTD to validate my xml files. Since the XmlReader seem to look for the DTD only in the folder where the xml file is, I need to somehow tell the reader to look into a specific folder where my dtd's are.

I though of XmlPreloadedResolver to solve this but I cannot find System.Xml.Utils.Dll in the GAC. Isn't this a standard .NET framework assembly?

EDIT: It seems this DLL relies on silverlight to be installed. Is there another way to use a dtd for validation which is in another folder than the xml file itself?


Solution

  • System.Xml.Utils.dll is not part of the standard .NET Framework. It is included as part of the Silverlight SDK. If you haven't already installed it, you can do so from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=1ea49236-0de7-41b1-81c8-a126ff39975b&displaylang=en

    Once you have it installed, the assembly you want to reference in your project will be under %PROGRAMFILES%\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\

    This assembly includes the class System.Xml.Resolvers.XmlPreloadedResolver