SGML is much harder to parse than XML as it has things like implicitly closing tags that close automatically (without specifying a closing tag).
I suspect that SGML has such features as it was more common when SGML was introduced in the 80s for humans to directly create SGML by hand than is the case for XML today, and so these features saved lots of typing. For example the OED was marked up (by hand?) in SGML in the 80s.
XML is a subset of SGML,which means it takes the pros that SGML has to offer. XML was designed to make parsing much easier. XML, rather than SGML, also is widely used for deriving document specifications.
The main difference is that SGML specifies the standard for how to specify a document markup language or tags whereas XML specifies the standard for user defined tags(i.e a user can define his own tag)
发布评论
评论(3)
SGML 比 XML 更难解析,因为它具有自动关闭的隐式结束标记(无需指定结束标记)之类的内容。
我怀疑 SGML 具有这样的功能,因为当 SGML 在 80 年代引入时,人们直接手动创建 SGML 比现在的 XML 更常见,因此这些功能节省了大量的打字时间。 例如,OED 在 80 年代是用 SGML 进行标记(手工?)的。
SGML is much harder to parse than XML as it has things like implicitly closing tags that close automatically (without specifying a closing tag).
I suspect that SGML has such features as it was more common when SGML was introduced in the 80s for humans to directly create SGML by hand than is the case for XML today, and so these features saved lots of typing. For example the OED was marked up (by hand?) in SGML in the 80s.
XML 是 SGML 的子集,这意味着它继承了 SGML 所提供的优点。 XML 旨在使解析变得更加容易。 XML(而不是 SGML)也广泛用于导出文档规范。
这里有更多讨论:
XML is a subset of SGML,which means it takes the pros that SGML has to offer. XML was designed to make parsing much easier. XML, rather than SGML, also is widely used for deriving document specifications.
more dicscussed here:
主要区别在于 SGML 指定了如何指定文档标记语言或标签的标准,而 XML 指定了用户定义标签的标准(即用户可以定义自己的标签)
为了清楚地说明我的答案,请参阅以下链接:
http://sdn.vlsm.org/share/LDP/authors/html/xmldifferences .html
谢谢。
The main difference is that SGML specifies the standard for how to specify a document markup language or tags whereas XML specifies the standard for user defined tags(i.e a user can define his own tag)
For clarity in my answer refer the below link:
http://sdn.vlsm.org/share/LDP/authors/html/xmldifferences.html
Thank you.