如何测试 .Net 中字符串(网页)的标记有效性?

发布于 2024-07-18 10:48:37 字数 144 浏览 10 评论 0原文

我编写了一个 VB.Net 页面来浏览我的网站。 它将 HttpWebResponse 存储在字符串中。 如何验证 .Net 中页面的标记有效性? - 类似于 W3 的直接输入验证选项。 我正在寻找可以识别 DOCTYPE、验证是或否并返回可以显示的失败列表的东西。

I've written a VB.Net page to browse my site. It stores the HttpWebResponse in a string. How can I validate the markup validity of the page in .Net? - something similar to W3's validate by direct input option. I'm looking for something that can identify the DOCTYPE, validate it yes or no, and return a list of failures I can display.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鼻尖触碰 2024-07-25 10:48:37

以下是有关如何执行此操作的一些信息:在 C# 中验证 XHTML(如果需要,您应该将其翻译为 VB.NET)。

还有一个可供下载的验证器模块。 唯一的缺点是字符串必须保存到物理 html 文件中。

Here's some information on how to that: Validate XHTML in C# (you should be to translate this into VB.NET if needed).

There's also a validator module available for download. The only drawback is that the string has to be saved into a physical html file.

北城半夏 2024-07-25 10:48:37

W3C 有一个实验性 API,可以接受可能有用的代码片段,并且还有其他第三方网络服务(尽管我不是确定他们是否也可以接受片段)。

恐怕我自己曾经使用过这些,所以我无法评论它们的有效性......

The W3C have a experimental API that can accept code fragments that might be of use, and there are other 3rd Party web services (though I'm not sure if they can accept fragments) as well.

I'm afraid I have ever used these myself so I can't comment on their effectiveness...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文