Java Xml 简明教程

Java XML Tutorial

Java XML Tutorial

XML(*E*X*tensible *M*arkup *L*anguage)是一种非常流行的简单的文本语言,可用作不同应用程序之间的通信方式。作为传输和存储数据的标准方式。JAVA 提供了大量出色的支持和丰富的库来解析、修改或查询 XML 文档。本教程将以一种简单且直观的方式教授基本的 XML 概念以及如何使用各种基于 Java 的 XML 解析器。

XML (E*X*tensible *M*arkup *L*anguage) is a very popular simple text-based language that can be used as a mode of communication between different applications. It is considered as a standard means to transport and store data. JAVA provides excellent support and a rich set of libraries to parse, modify or inquire XML documents. This tutorial will teach you basic XML concepts and the usage of various types of Java based XML parsers in a simple and intuitive way.

Why to Learn Java XML?

通常每天都会上载和下载数据。大多数数据以 XML 格式显示。很多商业应用程序均内置于 Java 中。我们有时需要向现有数据添加详细信息、更新现有数据、创建新的数据文件和查询文档。因此,我们应该了解如何在 Java 应用程序中访问 XML 文档以执行这些操作。

Data is often uploaded and downloaded on a daily basis. Most of the data is represented in XML format. Many business applications are built in Java. There are use cases where we need to add details to our existing data, update already existing data, create new data files and query the documents. So, We should know how to access XML documents to perform these operations in Java applications.

Java XML Applications

Java 有不同的库来解析 XML 文档,且 XML 作为一种易于学习和理解的语言,在很多领域均有其自身的应用。以下便是 Java XML 的各种应用 -

Java has different libraries to parse XML documents, and XML, being an easy-to-learn and understandable language, finds its applications in many areas. Following are the various applications of Java XML −

  1. To create layouts in android mobile applications.

  2. To store data related to orders, invoices, delivery details, and so on in e-Commerce websites.

  3. To implement security features such as encryption, authentication, authorization etc.

  4. To store and transfer data in different formats across applications.

  5. To make smooth data transfer among systems in distributed computing.

Who Should Learn Java XML?

此教程是为初学者准备的,用以帮助他们了解使用 Java 编程语言进行 XML 解析的基本到高级概念。完成此教程后,你会发现自己的 XML 解析(使用 Java)专业知识处于一个中等水平,从那里你可以将自己提升到更高的专业知识水平。

This tutorial has been prepared for beginners to help them understand the basic-to-advanced concepts related to XML parsing using Java Programming language. After completing this tutorial, you will find yourself at a moderate level of expertise in XML parsing using Java from where you can take yourself to higher levels of expertise.

Java 开发人员应该学习 Java XML,因为 Spring、Hibernate 等 Java 框架使用基于 XML 配置的工具。此外,处理 SOAP 等 Web 服务的人员也需要了解 Java XML。而且,集成专家使用 Java XML 来集成来自不同系统的数据。

Java developers should learn Java XML as Java frameworks such as Spring, Hibernate use tools based on XML configuration. Also people who work with web services such as SOAP should know about Java XML. Also, Integration specialists use Java XML to integrate data from different systems.

Prerequisites to Learn Java XML

你应对 Java 基本编程知识有了解,才能理解本教程涉及到的程序。对 XML 有预备知识将助你快速理解相关内容。然而,如果你对 XML 一无所知,也不用过于担心,因为我们有一个名为“Java XML 概览”的章节来涵盖本教程所需的 XML 所有基本知识。

You should have knowledge on basic java programming to understand the programs covered in this tutorial. Having prior knowledge about XML will help you understand things quickly. Yet, it is not a big issue if you don’t know anything about XML because we have a chapter named "Java XML overview" that covers all the basics of XML that are required for this tutorial.

Frequently Asked Questions about Java XML

对 Java XML 有一些经常问到的问题(FAQ),本部分将尝试简要回答这些问题。

There are some very Frequently Asked Questions(FAQ) about Java XML, this section tries to answer them briefly.