关于html5 dtd / schema的另一个问题 [英] Yet another question regarding the html5 dtd/schema

查看:124
本文介绍了关于html5 dtd / schema的另一个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果没有DTD或架构来验证H5文档,我们应该如何进行文档验证?通过文档验证,我的意思是我们应该如何确保我们的html5文档在语法上准确且结构合理?请帮忙!如果我们无法准确验证HTML5文档,这对我们的行业来说将成为一个巨大的问题!

If there is no DTD or schema to validate the H5 document against, how are we supposed to do document validation? And by document validation, I mean "how are we supposed to ensure our html5 documents are both syntactically accurate and structurally sound?" Please help! This is going to become a huge problem for our industry if we have no way to accurately validate HTML5 documents!

当然,W3C有一个在线工具可以验证各个页面。但是,如果我正在创建大量页面(数百个,比方说)并且我想以某种批处理模式验证它们,那么确保有效结构和语法的可接受方法是什么?我的意思是,仅仅查看文档并说是的,这是一个有效的xml文档似乎相当简陋。自定义标签怎么样?标签属性怎么样?好像W3C在这里稍微偏离了我们。

Sure, the W3C has an online tool that validates individual pages. But, if I'm creating A LOT of pages (hundreds, say) and I want to validate them in a sort of batch mode, what is the accepted method of ensuring valid structure and syntax? I mean, it seems rather rudimentary to just look at the document and say "yep. that's a valid xml document." What about custom tags? What about tag attributes? It seems like the W3C is leaving us out in the cold a little bit here.

也许最好的答案可以在HTML编辑器中找到。但是你得到了DTD /模式碎片。每个编辑器供应商都会自己呈现一个有效的结构。

Maybe the best answer will be found in the HTML editor. But then you get DTD/schema fragmentation. Each editor vendor coming up with their own rendition of what a valid structure is.

也许答案是等待HTML5成为官方。但我真的不能等待。我现在需要开始创建和验证内容。我有想要发布的应用程序,只能用html5完成。

Maybe the answer is "wait for HTML5 to become official". But I really can't wait for that. I need to start creating and validating content now. I have applications I want to publish that can only be accomplished with html5.

那么,有什么想法吗?

推荐答案


如果没有DTD或模式来验证H5文档,我们应该如何进行文档验证?

If there is no DTD or schema to validate the H5 document against, how are we supposed to do document validation?

使用专门的HTML5验证器,而不是通用的SGML或XML验证器。

With a specialized HTML5 validator rather then a generic SGML or XML validator.

显然,由于规范仍然存在草稿形式,存在的工具是不成熟的,可能会过时或过时。

Obviously, as the specification is still in draft form, the tools that do exist are immature and likely to be out of date or become out of date.


当然,W3C已经一个验证单个页面的在线工具。但是,如果我正在创建大量页面(数百,比方说)并且我想以某种批处理模式验证它们,那么确保有效结构和语法的可接受方法是什么?

Sure, the W3C has an online tool that validates individual pages. But, if I'm creating A LOT of pages (hundreds, say) and I want to validate them in a sort of batch mode, what is the accepted method of ensuring valid structure and syntax?

使用其他工具或下载W3C验证器并运行本地副本。它有一个SOAP API,因此编写批处理验证工具并不困难。

Either use a different tool or download the W3C validator and run a local copy. It has a SOAP API so writing a batch validation tool isn't difficult.


自定义标签怎么样?

What about custom tags?

HTML5不允许自定义元素。

HTML5 doesn't allow custom elements.


标签属性如何? ?

What about tag attributes?

HTML5中唯一的自定义属性是data- *属性,因此HTML 5验证器可以识别它们。

The only custom attributes in HTML5 are data-* attributes, so an HTML 5 validator can recognize them.


好像W3C在这里稍微偏冷了我们。

It seems like the W3C is leaving us out in the cold a little bit here.

看起来你期望HTML 5(未完成)的QA工具的状态达到与HTML 4(十多年前)相同的标准。这不是一个现实的期望。

It seems like you expect the state of QA tools for HTML 5 (unfinished) to be up to the same standard as those for HTML 4 (over a decade old). This isn't a realistic expectation.


也许最好的答案可以在HTML编辑器中找到。但是你得到了DTD /模式碎片。每个编辑器供应商都会自己呈现有效结构。

Maybe the best answer will be found in the HTML editor. But then you get DTD/schema fragmentation. Each editor vendor coming up with their own rendition of what a valid structure is.

规范很明确(虽然在变化中)即使它不以DTD或模式的形式表示。如果每个编辑器对什么是有效的有不同的想法,那么它们中的大多数或全部将会过时或只是错误。

The specification is clear (although in flux) even if it isn't expressed in the form of a DTD or schema. If each editor has a different idea of what is valid, then most or all of them are going to be either out of date or just buggy.


也许答案是等待HTML5成为官方。但我真的不能等待。我现在需要开始创建和验证内容。我有想要发布的应用程序,只能用html5来完成。

Maybe the answer is "wait for HTML5 to become official". But I really can't wait for that. I need to start creating and validating content now. I have applications I want to publish that can only be accomplished with html5.

如果你需要生活在最前沿,那么你必须接受这样做的限制和风险。

If you need to live in the bleeding edge, then you have to accept the limitations and risks of doing so.

这篇关于关于html5 dtd / schema的另一个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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