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数据文档就是你用刚刚编写的那个类的实例化,也就是按照类的定义申请了一个内存空间,并存储相应的数据。”

XSD是W3C推荐的XML SCHEMA标准,SCHEMA即描述XML的结构和元素关系的规则模式,他规定了一个xml文档可以使用那些元素、元素的类型以及一些限制规则。schema和DTD一样,都是描述xml的,只不过SCHEMA的内容更丰富,更具有扩展性,可以定义对象关系如主键和外键. 同时他本身也是一个xml文档,更方便解析。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值