是否有XHTML 5验证器? [英] Is there an XHTML 5 validator?

查看:88
本文介绍了是否有XHTML 5验证器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有专门针对XHTML 5的验证器,即HTML 5的XML序列化? W3C验证器支持文档类型:

Is there a validator specifically for XHTML 5, i.e. the XML serialization of HTML 5? The W3C validator supports the document types:


  • HTML 5(实验性)将其视为XML中不允许的有效各种功能,例如隐式关闭< br> 标签。

  • 几个 XHTML 1.0 XHTML 1.1 doctypes,无法识别HTML 5中的新标签。

  • HTML 5 (experimental): which treats as valid various features that are not allowed in XML, such as implicitly closed <br> tags.
  • several XHTML 1.0 and XHTML 1.1 doctypes, which don't recognize the new tags in HTML 5.

推荐答案

HTML 5的W3C验证器实际上确实检测并验证了XHTML 5:

The W3C validator for HTML 5 in fact does detect and validate XHTML 5:


  • 当通过URI验证时,它使用服务器提供的内容类型(如果指定 application / xhtml + xml ,则为XHTML)。

  • 按文件验证时上传或直接输入,它根据文件中是否存在 xmlns 属性来猜测。也就是说,

  • When validating by URI, it uses the content-type provided by the server (XHTML if it specifies application/xhtml+xml).
  • When validating by file upload or direct input, it guesses based on whether an xmlns attribute is present in the file. That is,

这被标识为XHTML(因此被正确标记为无效):

This is identified as XHTML (and is therefore correctly marked invalid):

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>test</title></head>
<body><br></body></html>

这被标识为HTML(因此被正确标记为有效):

This is identified as HTML (and is therefore correctly marked valid):

<!DOCTYPE html><html>
<head><title>test</title></head>
<body><br></body></html>

编辑:显然他们正在删除此自动识别功能。请参阅此错误

Edit: Apparently they're removing this auto-identification. See this bug.

这篇关于是否有XHTML 5验证器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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