DTD 是 Document Type Definition 的缩写,意为“文档类型定义”。它用于 XML/SGML 中,用来声明文档允许出现哪些元素、属性及其结构规则,从而帮助程序对文档进行 校验(validation)。
/ˌdiː tiː ˈdiː/
A DTD defines the structure of an XML document.
DTD 定义了 XML 文档的结构。
The editor rejected the file because it didn’t match the DTD specified in the DOCTYPE declaration.
编辑器拒绝了该文件,因为它不符合在 DOCTYPE 声明中指定的 DTD。
DTD 源自缩写 Document Type Definition,最初用于 SGML(标准通用标记语言),后来在 XML 中也沿用这一概念,用来描述“某类文档的合法格式”。