如何根据指定的 DTD 验证 xhtml 文件? [英] How to validate an xhtml file against a specified DTD?

查看:25
本文介绍了如何根据指定的 DTD 验证 xhtml 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在

string filePath = Assembly.GetExecutingAssembly().GetName().Name+"." + resourceFileName;    
Stream fileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(filePath);

现在我必须使用 fileStream 将我的 xhtml 文件与嵌入在资源文件中的 DTD 进行比较.如何做到这一点?

Now i have to use fileStream to compare my xhtml file against the DTDs that are embedded inside the resource file. How to do that?

推荐答案

好吧,我以为我知道的答案 (XmlValidatingReader) 现在已弃用/过时,具体取决于您的平台,但替换似乎很简单.示例 此处此处.

Well the answer I thought I knew (XmlValidatingReader) is now deprecated/obsolete depending on your platform, but the replacement seems straightforward. Examples here and here.

这篇关于如何根据指定的 DTD 验证 xhtml 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆