您的位置:首页 > 其它

zz XML/XSD/DTD(小知识)

2010-12-29 12:52 309 查看
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数据文档就是你用刚刚编写的那个类的实例化,也就是按照类的定义申请了一个内存空间,并存储相应的数据。”
XSD是W3C推荐的XML SCHEMA标准,SCHEMA即描述XML的结构和元素关系的规则模式,他规定了一个xml文档可以使用那些元素、元素的类型以及一些限制规则。schema和DTD一样,都是描述xml的,只不过SCHEMA的内容更丰富,更具有扩展性,同时他本身也是一个xml文档,更方便解析。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: