Xerces 简明教程

Apache Xerces - XML Parsers

What is Apache Xerces2?

Xerces2 是基于 Java 的处理器,并提供以下 XML 解析 API 标准的标准接口和实现:

Xerces2 is a Java based processor and provides standard interfaces and implementations for following XML parsing API standards −

  1. Document Object Model (DOM) Level 3

  2. Simple API for XML (SAX) 2.0.2

  3. Streaming API for XML (StAX) 1.0 Event API

  4. Java APIs for XML Processing (JAXP) 1.4

What is XML Parsing?

解析 XML 指的是遍历 XML 文档来访问数据或通过一种或另一种方式修改数据。

Parsing XML refers to going through the XML document to access data or to modify data in one or the other way.

What is XML Parser?

XML 解析器提供了一种访问或修改 XML 文档中存在的数据的方法。Java 提供了多种用于解析 XML 文档的选项。以下是用于解析 XML 文档的各种类型的解析器。

XML Parser provides a way to access or modify the data present in an XML document. Java provides multiple options to parse XML document. Following are various types of parsers which are commonly used to parse XML documents.

  1. Dom Parser − Parses the document by loading the complete contents of the document and creating its complete hierarchical tree in memory.

  2. SAX Parser − Parses the document on event based triggers. Does not load the complete document into the memory.

  3. StAX Parser − Parses the document in similar fashion to SAX parser but in a more efficient way.

现在,我们将在后续章节中使用 Apache Xerces 库来详细说明每个解析器。

Now, we will elaborate each parser using the Apache Xerces library in our subsequent chapters.