HTML5的子集或约束可以完美映射到XHTML5,反之亦然? [英] There are a subset or constraint of HTML5 that can be perfectly mapped into XHTML5, and vice-versa?

查看:179
本文介绍了HTML5的子集或约束可以完美映射到XHTML5,反之亦然?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用通用语言表示内容,也就是现在的 HTML5 标准—我的目标不是在网络浏览器中显示页面。我需要代表仅内容,没有界面,没有布局,没有逻辑(没有Javascript)。

I need to represent content in a lingua franca, that is, in nowadays, the HTML5 standard — my objective is not to show a page in the web-browser. I need to represent only content, no interface, no layout, no logic (no Javascript).

正如其他问题(或程序员问题),并 W3C HTML5的推荐标准,HTML vs XHTML部分


DOM,HTML语法和XHTML语法都不能代表相同的内容。

the DOM, the HTML syntax, and the XHTML syntax cannot all represent the same content.

好的,但是~90%可以是相同的(!),如果我不需要Javascript,样式等等,我可以强制执行一些约束,它将是100%...所以,问题是关于我需要使用什么约束(?)以确保所有序列化为XHTML5的HTML5代表相同的东西反之亦然(XSLT将使用原始HTML5文档返回)。

Ok, but ~90% can be the same (!), and, if I not need Javascript, Styles, etc. and I can enforce some constraints, it will be 100%... So, the question is about what constraints I need to use (?) to ensure that all HTML5 serialized as XHTML5 will be represent the same thing, and vice-versa (an XSLT that will back with the original HTML5 document).

有一个  HTML5元素的子集 或者带有一些附加限制的子集 确保XHTML5 / HTML5转换的可逆性

There are a  "subset of HTML5 elemements"  or a  "subset with some aditional constraints"  that ensures the reversibility of XHTML5/HTML5 convertions?

推荐答案

Polyglot标记:HTML5词汇表的强大配置文件 ,目前是 W3C候选推荐,定义文档规则


[...]这是一个字节流解析成相同的文档树(有一些例外情况,如简介)当以HTML格式处理或以XML格式处理时。

[…] that is a stream of bytes that parses into identical document trees (with some exceptions, as noted in the Introduction) when processed either as HTML or when processed as XML.

您可以找到编写此类规则的规则文件第4部分:编写HTML文档

You can find the rules for writing such a document in section 4: Writing HTML documents.

这篇关于HTML5的子集或约束可以完美映射到XHTML5,反之亦然?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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