简体   繁体   English

自动W3C验证

[英]Automated W3C Validation

I'd like to use MSBUILD to check the validity of both the rendered HTML and CSS of all pages in a site, and break the build on errors. 我想使用MSBUILD来检查站点中所有页面的呈现HTML和CSS的有效性,并打破错误的构建。

Can anyone recommend a strategy to validate HTML and CSS in an automated build? 任何人都可以推荐一种在自动构建中验证HTML和CSS的策略吗? Are there any tasks out there to do this now? 现在有什么任务可以做到这一点吗?

I can't tell you how to do this in MSBuild, but I can tell you how I would approach this task. 我不能告诉你如何在MSBuild中这样做,但我可以告诉你我将如何处理这个任务。

  1. Download the W3C CSS Validator 下载W3C CSS验证器
  2. Run it as a step in your CI platform ( Hudson or CC.net) against all your .css files 将其作为CI平台( Hudson或CC.net)中的一个步骤,针对所有.css文件运行
  3. Find a downloadable Markup Validator, ( W3 & WDG , thanks David!) 找一个可下载的标记验证器,( W3WDG ,谢谢David!)
  4. Find a way to host all your dynamic pages (IIS, maybe WebDev.WebServer.exe) 找到一种方法来托管所有动态页面(IIS,也许是WebDev.WebServer.exe)
  5. Download the content of all the dynamic pages*** 下载所有动态页面的内容***
  6. Run it against the Markup Validator as a step in your CI platform. 作为CI平台中的一个步骤,针对标记验证器运行它。

*Step # 5 will be somewhat tricky because you'll likely have to maintain a list of URL's to test, since you cant just open up the .aspx files, and if you're running MVC, the urls will be almost impossible to automatically generate based on the files themselves due to routing etc. *步骤#5有点棘手,因为你可能不得不维护一个要测试的URL列表,因为你不能打开.aspx文件,如果你正在运行MVC,那么网址几乎不可能自动生成由于路由等原因而生成的文件本身

Seems like someone could easily make a CSS (maybe one for staic html too) validator plugin for Hudson or CC.net quite easily, you could even display the results quite nicely in a trend graph, etc. 好像有人可以很容易地为Hudson或CC.net轻松制作一个CSS(也许是一个用于staic html的)验证器插件,你甚至可以在趋势图中很好地显示结果等。

I haven't played around with using MSBuild to do this stuff too much because I use Hudson. 我没有玩过使用MSBuild这么做太多,因为我使用Hudson。 However, I think you should be able to do all of this quite easily as post build commands since its all just command line stuff. 但是,我认为你应该可以很容易地完成所有这些作为post build命令,因为它只是命令行的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 请帮我解决我的 W3C 验证 API 超时问题 - Please help me solve my W3C validation API timeout issue 为什么我使用.net的XMLWriter创建的每个XML文件都无法通过W3C验证? - Why does every XML file I create with .net's XMLWriter fail W3C validation? .Net命名约定与W3C规范 - .Net naming conventions vs W3C specifications 如何使用Html.TextBoxFor(C#)设置默认值,使其符合W3C标记? - How to set a default value with Html.TextBoxFor (C#) so it is W3C markup compliant? 如何在我的 .NET 应用程序中使用 W3C 标记验证器 API? - How might I use the W3C Markup Validator API in my .NET application? 如何将DateTime .NET数据类型转换为W3C XML DateTime数据类型字符串并返回? - How do I convert DateTime .NET datatype to W3C XML DateTime data type string and back? W3C或任何标准机构是否在为实体属性ORM定义制定单一标准? - Is the W3C or any standards body working on a single standard for Entity Attribute ORM definitions? 自定义页面类与自动卸载事件 - Custom Page Class w/ automated unload Event WinForms C#或VB中的自动化WebBrowser控件 - Automated WebBrowser Control in WinForms C# or VB c#:自动测试中的 DllImport 问题 - c#: Problem with DllImport on automated testing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM