dom和sax(simple api for xml) 概念

什么是 DOM?

DOM 是 W3C(World Wide Web Consortium)标准。

DOM 定义了访问诸如 XML 和 HTML 文档的标准:

"W3C 文档对象模型(DOM,全称 Document Object Model)是一个使程序和脚本有能力动态地访问和更新文档的内容、结构以及样式的平台和语言中立的接口。"

DOM 被分为 3 个不同的部分/级别:

  • 核心 DOM - 用于任何结构化文档的标准模型
  • XML DOM - 用于 XML 文档的标准模型
  • HTML DOM - 用于 HTML 文档的标准模型

DOM 定义了所有文档元素的对象和属性,以及访问它们的方法(接口)。

 

 

https://en.wikipedia.org/wiki/Simple_API_for_XML

 

SAX (Simple API for XML) is an event-driven online algorithm for parsing XML documents, with an API developed by the XML-DEV mailing list.[1] SAX provides a mechanism for reading data from an XML document that is an alternative to that provided by the Document Object Model (DOM). Where the DOM operates on the document as a whole, SAX parsers operate on each piece of the XML document sequentially.

 

Definition[edit]

Unlike DOM, there is no formal specification for SAX. The Java implementation of SAX is considered to be normative.[2] SAX processes documents state-independently, in contrast to DOM which is used for state-dependent processing of XML documents.[3] SAX parsers contrast with DOM-style parsers in a similar waysingle-pass compilers contrast with multi-pass ones.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值