这部分内容主要提纲挈领的讲讲JAXP,讲讲他的几个重要部分,基本的工作原理,还有重要的api。
DocumentBuilderFactory, and TransformerFactory
--which give you a SAXParser
, a DocumentBuilder
, and an XSLT transformerjavax.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
SAXParserFactory:用来获取一个Parser实例的。
SAXParser:定义了几个parser()函数,需要传入XML Source和handler的对象。
SAXReader:SAXParser wraps SAXReader(需要看看)
DefaultHandler,ContentHandler,ErrorHandler,DTDHandler ,EntityResolver
重要的package:
org.xml.sax:
org.xml.sax.ext
org.xml.sax.helpers
DocumentBuilderFactory
class and the DocumentBuilder
class, which returns an object that implements the W3C Document
interface.A source object can be created from a SAX reader, from a DOM, or from an input stream. Similarly, the result object is the result of the transformation process. That object can be a SAX event handler, a DOM, or an output stream.
javax.xml.transform: Defines the TransformerFactory
and Transformer
classes
javax.xml.transform.dom:
javax.xml.transform.sax:
javax.xml.transform.stream :


javax.xml.parsers
: Defines the SAXParserFactory
class, which returns the SAXParser
. Also defines exception classes for reporting errors.