gpt4 book ai didi

xml - 有一个 HTML5 的子集或约束可以完美映射到 XHTML5,反之亦然?

转载 作者:数据小太阳 更新时间:2023-10-29 02:12:11 26 4
gpt4 key购买 nike

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

正如在 other questions 中所记(或 programmers questions )和 the W3C HTML5's Recommendation, "HTML vs XHTML" section ,

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

好的,但是大约 90% 可以是相同的 (!),而且,如果我不需要 Javascript、Styles 等并且我可以强制执行一些约束,它将是 100%...所以,问题是关于我需要使用什么约束(?)来确保所有序列化为 XHTML5 的 HTML5 都代表同一事物,反之亦然(一个 XSLT 将支持原始 HTML5 文档)。 p>

有一个 “HTML5 元素的子集” 或一个 “具有一些附加约束的子集” 确保 reversibility的 XHTML5/HTML5 转换?

最佳答案

Polyglot Markup: A robust profile of the HTML5 vocabulary , 目前是 W3C Candidate Recommendation , 定义文档的规则

[…] 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.

您可以在 section 4: Writing HTML documents 中找到编写此类文档的规则.

关于xml - 有一个 HTML5 的子集或约束可以完美映射到 XHTML5,反之亦然?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28419046/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com