如何在没有 System.Xml.Utils.Dll(XmlPreloadedResolver) 的情况下解析本地 DTD?
我使用外部 DTD 来验证我的 xml 文件。由于 XmlReader 似乎只在 xml 文件所在的文件夹中查找 DTD,因此我需要以某种方式告诉读者查看 dtd 所在的特定文件夹。
我想用 XmlPreloadedResolver 来解决这个问题,但我在 GAC 中找不到 System.Xml.Utils.Dll。这不是一个标准的.NET框架程序集吗?
编辑:看来这个 DLL 依赖于 silverlight 来安装。是否有另一种方法可以使用位于 xml 文件本身之外的另一个文件夹中的 dtd 进行验证?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
System.Xml.Utils.dll 不是标准 .NET Framework 的一部分。它作为 Silverlight SDK 的一部分包含在内。如果您尚未安装,可以从此处进行安装:http://www.microsoft.com/downloads/details.aspx?FamilyID=1ea49236-0de7-41b1-81c8-a126ff39975b&displaylang=en
安装后,您要在项目中引用的程序集将位于 %PROGRAMFILES%\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\ 下。
此程序集包含类 System.Xml.Resolvers.XmlPreloadedResolver
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
.netfx 4.0 在 System.Xml.dll 中包含 XmlPreloadedResolver。请参阅 http://msdn.microsoft.com/en -us/library/system.xml.resolvers.xmlpreloadedresolver.aspx 了解详细信息。
.netfx 4.0 includes XmlPreloadedResolver in the System.Xml.dll. See http://msdn.microsoft.com/en-us/library/system.xml.resolvers.xmlpreloadedresolver.aspx for details.
根据这篇文章,
System.Xml.Utils.dll
是“可选的,将根据使用情况包含在包 (XAP) 中”。看来这个程序集与 Silverlight 相关;在我的机器上,我刚刚在
%ProgramFiles%\Microsoft SDKs\Silverlight\v?.0\Libraries\Client
目录中找到它According this article,
System.Xml.Utils.dll
is "optional and will be included in the package (XAP) based on the usage".Seems this assembly is Silverlight related; on my machine, I just found it inside
%ProgramFiles%\Microsoft SDKs\Silverlight\v?.0\Libraries\Client
directories