📜  DTD与XSD

📅  最后修改于: 2020-12-25 04:45:52             🧑  作者: Mango

DTD与XSD

DTD(文档类型定义)和XSD(XML模式定义)之间有很多区别。简而言之,DTD对XML结构的控制较少,而XSD(XML模式)提供的控制较多。

重要区别如下:

No. DTD XSD
1) DTD stands for Document Type Definition. XSD stands for XML Schema Definition.
2) DTDs are derived from SGML syntax. XSDs are written in XML.
3) DTD doesn’t support datatypes. XSD supports datatypes for elements and attributes.
4) DTD doesn’t support namespace. XSD supports namespace.
5) DTD doesn’t define order for child elements. XSD defines order for child elements.
6) DTD is not extensible. XSD is extensible.
7) DTD is not simple to learn. XSD is simple to learn because you don’t need to learn new language.
8) DTD provides less control on XML structure. XSD provides more control on XML structure.