首页 > 代码库 > SGML是什么

SGML是什么

SGML / Standard Generalized Markup Language / 标准通用标记语言

## A brief SGML tutorial

https://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html

看完上面这篇简明教程。SGML就是用来定义一个标记语言的语言,比如用SGML写一个DTD(文档类型的定义),定义有哪些元素,元素有哪些属性,是否需要标记是否需要关闭之类的。HTML理论上一个基于SGML的语言。直到HTML5,HTML5不基于SGML,所以在html5的开头也不引用一个DTD。

## HTML 5, one vocabulary, two serializations

https://www.w3.org/blog/2008/01/html5-is-html-and-xml/

It seems not very clear for many people. So let’s set the record straight. HTML 5 can be written in html and XML.

HTML 5 specification is the description of a vocabulary that you can write in two different syntaxes (html and XML) depending on your developer needs, markets and applications. The precedent versions of the HTML vocabulary (HTML+, HTML 2.0, HTML 3.2) were written using SGML syntax rules. HTML 4 had already two syntaxes: SGML (called HTML 4.01) and XML (called XHTML 1.0).

HTML 5 is being written in two syntaxes: html and XML. Because SGML has never been deployed in browsers and many html authoring tools, HTML 5 defines a new serialization called html, which looks a lot like the previous known SGML.

技术分享

SGML是什么