JavaEE - Introduction to XML

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

Introduction to XML

XML is an extensible markup language released by W3C in February 1998. It is a markup language used to mark data files to make them structured. It is designed to transmit and store data. In an electronic computer, a mark refers to an information symbol that can be understood by a computer. Through this mark, a variety of information, such as articles, can be processed between computers. It can be used to mark data, define data types, and is a source language that allows users to define their own markup language. It is very suitable for Internet transmission, providing a unified method to describe and exchange structured data independent of application or vendor, using XML can also simplify the transmission of document information on the Internet.

XML is syntactically identical to HTML. Unlike HTML, XML is designed to transmit and store data, while HTML is designed to display data. They are both subsets of the standard general-purpose markup language. XML tags are not pre-defined, you need to define your own tags, so it is called extensible markup language.

On August 18, the same year after XML was published, W3C released the draft of XSLT, and on November 16, 1999, it officially released the recommended version of XSLT 1.0. XSMLT is an acronym for eXtensible Stylesheet Language Transformation.

XSMLT is mainly used to convert XML documents into documents that can be parsed by browsers, such as HTML and XHTML. Converting into a browser-parsed document allows us to view the data of the XML document on the browser page more intuitively, and can use CSS to add style effects, such as:

image

In this way, using XSMLT to transform is more clear and intuitive than reading XML documents directly. This is the main role of XSMLT.
But now XSMLT is seldom used and almost eliminated, and XML is also less and less used in some data transmissions that require lightweight because it is too cumbersome, but XML is still used in some cases with complex data structures .

Document structure definition DTD and Schema introduction:
DTD: Document Type Definition (Document Type Definition) is a set of grammar rules about tags established for data exchange between programs. It is part of the Standard Generalized Markup Language and Extensible Markup Language version 1.0 specification, and documents can be validated against certain DTD syntax rules for conformance to this rule. The document type definition can also be used to ensure the legality of the standard general markup language and extensible markup language document format. By comparing the document and the document type definition file to check whether the document conforms to the specification, and whether the elements and tags are used correctly. A file instance provides an application a format for data exchange. The purpose of using various document type definitions is to make the standard general markup language and extensible markup language files comply with the specified data exchange standards, because in this way, different companies only need to define the standard document type definitions, and they can build according to the document type definitions. Document instances, and verify them, so that data can be easily exchanged, preventing data exchange obstacles caused by different instance data definitions and other reasons, and satisfying network sharing and data interaction.

image

Internal declaration code example:

image

Example of external declaration code:

image

The DOCTYPE at the beginning of HTML introduces a document type definition document:

image

Schema: Schema is an XML-based DTD replacement, Schema is a more strict definition of the document structure. Schem became a W3C standard on May 2, 2001. Schem needs to be more complete and more powerful, which is an upgraded version similar to DTD.

image

mind Mapping:

image

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326710352&siteId=291194637