The SAX and DOM APIs are defined by the XML-DEV group and by the W3C, respectively. The libraries that define those APIs are as follows:

  • javax.xml.parsers: The JAXP APIs, which provide a common interface for different vendors' SAX and DOM parsers.

  • org.w3c.dom: Defines the Document class (a DOM) as well as classes for all the components of a DOM.

  • org.xml.sax: Defines the basic SAX APIs.

  • javax.xml.transform: Defines the XSLT APIs that let you transform XML into other forms.

  • javax.xml.stream: Provides StAX-specific transformation APIs.

The Simple API for XML (SAX) is the event-driven, serial-access mechanism that does element-by-element processing. The API for this level reads and writes XML to a data repository or the web. For server-side and high-performance applications, you will want to fully understand this level. But for many applications, a minimal understanding will suffice.

The DOM API is generally an easier API to use. It provides a familiar tree structure of objects. You can use the DOM API to manipulate the hierarchy of application objects it encapsulates. The DOM API is ideal for interactive applications because the entire object model is present in memory, where it can be accessed and manipulated by the user.

On the other hand, constructing the DOM requires reading the entire XML structure and holding the object tree in memory, so it is much more CPU- and memory-intensive. For that reason, the SAX API tends to be preferred for server-side applications and data filters that do not require an in-memory representation of the data.

The XSLT APIs defined in javax.xml.transform let you write XML data to a file or convert it into other forms. As shown in the XSLT section of this tutorial, you can even use it in conjunction with the SAX APIs to convert legacy data to XML.

Finally, the StAX APIs defined in javax.xml.stream provide a streaming Java technology-based, event-driven, pull-parsing API for reading and writing XML documents. StAX offers a simpler programming model than SAX and more efficient memory management than DOM.

Overview of the Packages JAXP的更多相关文章

  1. rebuild new environment for DW step

    Steps to rebuild PPE environment: (CTS) 1, Disable both CTS Daily Job (Daily) and CTS Daily Job (Sta ...

  2. 星火计划ROS机器人Spark

    星火计划ROS机器人Spark 1 http://wiki.ros.org/Robots/Spark 2 https://github.com/NXROBO/spark ---- Spark Spar ...

  3. 老李分享: Oracle Performance Tuning Overview 翻译下

    1.2性能调优特性和工具 Effective data collection and analysis isessential for identifying and correcting perfo ...

  4. The packages can be overrided by Java Endorsed Standards

     Endorsed Standards APIs The Endorsed Standards for Java SE constitute all classes and interfaces ...

  5. BuildTools Overview

    SCons Pros: Based on a full-fledged programming language, Python. This means you can make the build ...

  6. Buildroot構建指南--Overview【转】

    本文转载自:http://www.unixlinux.online/unixlinux/linuxjc/gylinux/201703/65218.html Buildroot構建指南--Overvie ...

  7. An Overview of Cisco IOS Versions and Naming

    An Overview of Cisco IOS Versions and Naming http://www.ciscopress.com/articles/article.asp?p=210654 ...

  8. Folly: Facebook Open-source Library Readme.md 和 Overview.md(感觉包含的东西并不多,还是Boost更有用)

    folly/ For a high level overview see the README Components Below is a list of (some) Folly component ...

  9. Python Modules and Packages – An Introduction

    This article explores Python modules and Python packages, two mechanisms that facilitate modular pro ...

随机推荐

  1. InkPicture 控件使用_01

    private System.ComponentModel.Container components = null;  private Microsoft.Ink.InkOverlay m_InkOv ...

  2. c#解决数据库用in的时候大于1000报错问题

    问题: //oracle数据库报错 ,,,,,,,.....); c#写了一个方法解决 /// <summary> /// 拼接sql /// </summary> /// & ...

  3. web前端必须掌握的localStorage

    先自我介绍一下,本人男,27岁,单身,web前端程序员一枚,长期潜伏在幕后,只学不教(貔貅么?),其实主要是工作太忙了,每天忙到11点左右,没有时间写东西,洗洗就睡了.最近赶巧,后端那边出技术瓶颈了, ...

  4. 也说_T、_TEXT、TEXT、L

    本片文章转载自:http://www.cnblogs.com/sobe/archive/2011/03/14/1984188.html 百度或谷歌一下,有很多大牛早已经写过无数相关的文章说明这几个宏的 ...

  5. 13个小技巧帮你征服Xcode

    本文由CocoaChina翻译组成员唧唧歪歪(博客)翻译自David McGraw的博客原文:13 Xcode Tips That Will Help You Conquer Xcode当谈论到iOS ...

  6. Emmet Documentation

    src:http://docs.emmet.io/cheat-sheet/ Emmet Documentation Syntax   Child: > nav>ul>li <n ...

  7. C语言中调用Lua

    C语言和Lua天生有两大隔阂: 一.C语言是静态数据类型,Lua是动态数据类型 二.C语言需要程序员管理内存,Lua自动管理内存 为了跨越世俗走到一起,肯定需要解决方案. 解决第一点看上去比较容易,C ...

  8. 【web安全】第四弹:防火墙技术笔记

    参考资料: <黑客攻防演习>第二版   Ed SKoudis  Tom Liston著 <防火墙.入侵检测与VPN> 马春光 郭方方著 OSI在理论上将网络分为七层,物理层.数 ...

  9. 【python之路6】pycharm的使用

    1.pycharm简介 PyCharm 是我众多python编辑器中比较好的一个.而且可以跨平台,在macos和windows下面都可以用,这点比较好. PyCharm是一种Python IDE,带有 ...

  10. MIME

    http://www1.huachu.com.cn/read/readbookinfo.asp?sectionid=1000000558 http://www.jb51.net/hack/10623. ...