是否可以向Visual Studio添加HTML5验证?

时间:2022-11-14 07:58:05

I'm working on a page using <canvas>, which is a HTML5 tag, in Visual Web Developer Express Edition 2008, and the validator in the HTML editor is telling me it's an invalid tag. That's because it's set to validate against XHTML 1.0 Transitional. I'd prefer for it to not do that and tell me what's valid or invalid based on the HTML5 doctype, but I can't find anywhere in the preferences that suggests this would be possible.

我在一个页面上使用 ,这是一个HTML5标签,在Visual Web Developer Express Edition 2008中,而HTML编辑器中的validator告诉我它是一个无效的标记。这是因为它将对XHTML 1.0过渡进行验证。我更希望它不要这样做,并告诉我基于HTML5 doctype的有效或无效,但是我在偏好中找不到建议这是可能的。

Is there a way to tell Visual Studio to validate against HTML5, or add a new spec reference manually? I'd prefer not to have to go in and add tags manually, which appears to be the only option at the moment.

是否有办法让Visual Studio对HTML5进行验证,或者手动添加新的规范引用?我宁愿不需要手动添加标签,这似乎是目前唯一的选择。

5 个解决方案

#1


25  

It looks like the Visual Web Developer team solved the problem by adding HTML5 support themselves: http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and-validation-schema-for-visual-studio-2008-and-visual-web-developer.aspx

看起来,Visual Web开发团队通过添加HTML5来解决这个问题:http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and- Visual -studio- 2008and - Visual - Web Developer .aspx。

You all probably know that new HTML 5 standard is coming. We made a new intellisense schema that you can add to VS 2008 or VWD Express 2008 and get intellisense and validation on HTML 5 elements.

您可能都知道新的HTML 5标准即将到来。我们创建了一个新的智能感知模式,您可以添加到VS 2008或VWD Express 2008,并获得HTML 5元素的智能感知和验证。

#2


8  

For Visual Studio 2010 you'll want to install the Web Standards Update for Visual Studio 2010 SP1:

对于Visual Studio 2010,您需要安装Visual Studio 2010 SP1的Web标准更新:

It updates the HTML5 intellisense and validation to reflect the latest W3C specifications and fixes some bugs bugs in the current SP1 support for HTML5. Also JavaScript intellisense it updated to reflect many of the new browser capabilities such as Geolocation and DOM storage. Finally, this update adds comprehensive CSS3 intellisense and validation based on the latest specifications from W3C.

它更新了HTML5智能感知和验证,以反映最新的W3C规范,并修复了当前SP1对HTML5支持的一些bug。JavaScript的智能感知也反映了许多新的浏览器功能,比如地理定位和DOM存储。最后,该更新基于W3C的最新规范添加了全面的CSS3智能感知和验证。

For Visual Studio 2008, Microsoft has provided an updated version of the HTML 5 validation schema and intellisense in the Visual Studio Gallery.

对于Visual Studio 2008,微软在Visual Studio Gallery中提供了HTML 5验证模式和智能感知的更新版本。

HTML 5 Intellisense

HTML 5智能感知

The updated schema was posted by Mikhail Arkhipov, the same Microsoft employee who wrote the blog post linked in Rahul's answer.

更新后的图式是由米哈伊尔·阿克希波夫(Mikhail Arkhipov)发布的,他也是微软的一名员工,他写了一篇与拉胡尔的答案有关的博客文章。

#3


2  

I created a validation schema that you're free to use: http://johndyer.name/post/2009/07/21/HTML5-XHTML5-Validation-Schema-for-Visual-Studio-2008.aspx

我创建了一个可以*使用的验证模式:http://johndyer.name/post/2009/07/21/html5 - xhtml5 - validationschema - visualstudio2008.aspx。

#4


1  

This is now included in Visual Studio 2010 SP1

这现在包括在Visual Studio 2010 SP1中。

#5


0  

You can define your own validation standards.

您可以定义自己的验证标准。

You need to add the file to the folder in VS install, and add to the registry.

您需要将文件添加到VS安装的文件夹中,并添加到注册表中。

This is the description I used (HTML and CSS have a very similar approach): http://blogs.msdn.com/mikhailarkhipov/archive/2007/10/19/how-to-create-custom-css-intellisense-schema-in-visual-studio-2005-and-2008.aspx

这是我所使用的描述(HTML和CSS有一个非常相似的方法):http://blogs.msdn.com/mikhailarkhipov/archive/2007/10/19/howto -creat -creat - design -in-visual- design -in- visualstudio2005和2008.aspx。

#1


25  

It looks like the Visual Web Developer team solved the problem by adding HTML5 support themselves: http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and-validation-schema-for-visual-studio-2008-and-visual-web-developer.aspx

看起来,Visual Web开发团队通过添加HTML5来解决这个问题:http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and- Visual -studio- 2008and - Visual - Web Developer .aspx。

You all probably know that new HTML 5 standard is coming. We made a new intellisense schema that you can add to VS 2008 or VWD Express 2008 and get intellisense and validation on HTML 5 elements.

您可能都知道新的HTML 5标准即将到来。我们创建了一个新的智能感知模式,您可以添加到VS 2008或VWD Express 2008,并获得HTML 5元素的智能感知和验证。

#2


8  

For Visual Studio 2010 you'll want to install the Web Standards Update for Visual Studio 2010 SP1:

对于Visual Studio 2010,您需要安装Visual Studio 2010 SP1的Web标准更新:

It updates the HTML5 intellisense and validation to reflect the latest W3C specifications and fixes some bugs bugs in the current SP1 support for HTML5. Also JavaScript intellisense it updated to reflect many of the new browser capabilities such as Geolocation and DOM storage. Finally, this update adds comprehensive CSS3 intellisense and validation based on the latest specifications from W3C.

它更新了HTML5智能感知和验证,以反映最新的W3C规范,并修复了当前SP1对HTML5支持的一些bug。JavaScript的智能感知也反映了许多新的浏览器功能,比如地理定位和DOM存储。最后,该更新基于W3C的最新规范添加了全面的CSS3智能感知和验证。

For Visual Studio 2008, Microsoft has provided an updated version of the HTML 5 validation schema and intellisense in the Visual Studio Gallery.

对于Visual Studio 2008,微软在Visual Studio Gallery中提供了HTML 5验证模式和智能感知的更新版本。

HTML 5 Intellisense

HTML 5智能感知

The updated schema was posted by Mikhail Arkhipov, the same Microsoft employee who wrote the blog post linked in Rahul's answer.

更新后的图式是由米哈伊尔·阿克希波夫(Mikhail Arkhipov)发布的,他也是微软的一名员工,他写了一篇与拉胡尔的答案有关的博客文章。

#3


2  

I created a validation schema that you're free to use: http://johndyer.name/post/2009/07/21/HTML5-XHTML5-Validation-Schema-for-Visual-Studio-2008.aspx

我创建了一个可以*使用的验证模式:http://johndyer.name/post/2009/07/21/html5 - xhtml5 - validationschema - visualstudio2008.aspx。

#4


1  

This is now included in Visual Studio 2010 SP1

这现在包括在Visual Studio 2010 SP1中。

#5


0  

You can define your own validation standards.

您可以定义自己的验证标准。

You need to add the file to the folder in VS install, and add to the registry.

您需要将文件添加到VS安装的文件夹中,并添加到注册表中。

This is the description I used (HTML and CSS have a very similar approach): http://blogs.msdn.com/mikhailarkhipov/archive/2007/10/19/how-to-create-custom-css-intellisense-schema-in-visual-studio-2005-and-2008.aspx

这是我所使用的描述(HTML和CSS有一个非常相似的方法):http://blogs.msdn.com/mikhailarkhipov/archive/2007/10/19/howto -creat -creat - design -in-visual- design -in- visualstudio2005和2008.aspx。