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. 网站开发常用jQuery插件总结(十)菜单插件superfish

    网站对于菜单的依赖其实并不是很大,我们完全可以不使用菜单来设计网站,显示网站内容.但是如果网站的分类太多,“也许”使用菜单作为网站导航可以使 用户 更方便的寻找内容.superfish插件就是用于实现 ...

  2. tp中调用PHP系统扩展类

    例如使用Redis扩展类: use Reids; $redis = new Redis();

  3. ubuntu远程登陆windows

    首先安装rdesktop : apt-get install rdesktop.p 程序安装完后,在终端命令行中输入:$ rdesktop -g 1024x768 -d 24 ip,就进入了windo ...

  4. mysql可视化管理工具

    1.navicat for mysql 2.navicat premium 3.HeidiSQL 4.MySQLWorkbench

  5. struts2整合jfreechart

    需要的包: struts2-jfreechart-plugin-2.2.1.1.jar jfreechart-1.0.13.jar jcommon-1.0.17.jar 前台jsp页面中可以使用ifr ...

  6. react + iscroll5

    react + iscroll5 经过几天的反复折腾,总算做出一个体验还不错的列表页了,主要支持了下拉刷新,上拉加载两个功能. 一开始直接采用了react-iscroll插件,它是基于iscroll插 ...

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

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

  8. Quartz1.8.5例子(十一)

    /* * Copyright 2005 - 2009 Terracotta, Inc. * * Licensed under the Apache License, Version 2.0 (the ...

  9. JVM 学习笔记(二)

    JVM 堆中几乎存放着java中所有的对象实例,在在垃圾回收前先要判断对象是否已死,这里对对象的判断主要有: 1.  引用计数法 给对象中添加一个引用计数器,每当有一个地方引用他时,计数器就加1:当引 ...

  10. POJ2103 Jackpot

    Description The Great Dodgers company has recently developed a brand-new playing machine. You put a ...