zyongsheng83 发表于 2013-1-29 07:41:44

xsd and dtd

DTD:The purpose of a Document Type Definition is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements.
XML Schema:XML Schema is an XML based alternative to DTD.An XML schema describes the structure of an XML document.The XML Schema language is also referred to as XML Schema Definition (XSD).
CSS = HTML Style Sheets:HTML uses predefined tags and the meaning of the tags are well understood.
XSL = XML Style Sheets:XML does not use predefined tags (we can use any tag-names we like), and the meaning of these tags are not well understood.
DTD和Schema都是验证xml合法性的文档类型定义.DTD有其自身的语法,而Schema使用xml标记,而且支持更多的数据类型.因此,Schema慢慢将取代DTD.xml的优势在于它的通用性,尤其在网络上传输数据时.
XSD是XML Schema Definition的缩写,它本身也是XMl的一个变形子集,用于规定XMl文档的格式。举个例子说:“XMl是C语言,那么XSD就是你用C语言编写的类,而某个XMl数据文档就是你用刚刚编写的那个类的实例化,也就是按照类的定义申请了一个内存空间,并存储相应的数据。”
页: [1]
查看完整版本: xsd and dtd