XML overview

zhaozj2021-02-16  74

What is XML

XML represents Extensible Markup Language (Extensible Markup Language Abbreviation, intended to scaleable tag language). XML is a set of rules that define semantic tags that divide documents into many parts and identify them. It is also a meta-marking language that defines syntax language for defining other, semantic, structured marking languages ​​related to specific areas.

1.1.1

XML is a meta-marker language

The first thing to understand about XML is that it is not just like hypertext markup language (HTML) or formatted programs. These languages ​​define a fixed tag to describe a certain number of elements. If there is no tag in the tag language, the user has no way. At this time, I have to wait for the next version of the tag language, I hope to include the desired tag in the new version, but this will depend on the software developer's choice.

But XML is a meta-marker language. Users can define their own tags. These tags must be created according to certain general principles, but in the sense of marking, it also has considerable flexibility. For example, if the user is processing things related to genealogy, it is necessary to describe people's birth, death, burial, family, marriage, divorce, etc., this must be created for each of the tags. The newly created tag can be described in the document type definition (Document Type Definition, often referred to as DTD in the subsequent space). More knowledge about DTD will be learned in the second part of this book. Now, simply think of DTD as a syntax of a word gllit and a certain type of document. For example, the syntax of vocabulary and molecular science is described in the MOL.DTD file in Peter Murray-Rust's MOL.DTD file: including Chemistry, Crystallography (crystalline), Words such as Solid State Physics (Solid Physics). It includes tags for Atoms (atoms), Molecules (Molecules), Bonds, SpecTra (spectrum). This DTD can be shared with many different people in the field of molecular science. For other fields, there are other DTDs, users can also create their own DTD.

XML defines a set of paragraph sypocations that must be observed with markup languages ​​related to specific areas (such as MusicML, Mathml, and CML). If an application can understand this element, then it will automatically understand all languages ​​established by this meta language. The browser does not have to know each mark used in multiple different markings in advance. The fact is that the browser understands the tag used by the given document when reading a document or its DTD. Detailed instructions on how to display these tags are additional styles that are attached to the document. For example, consider Schrodinger equation:

The scientific papers are full of this type of equation, but scientists must wait for many years to allow the browser's developers to support the markings needed to write the most basic mathematical formula. Musicians also have the same limitations because Netscape Navigator and Internet Explorer also do not support scores.

With XML means that you don't have to wait for the browser's developer to meet the needs of users. Users can create their own tags, telling the browser how to display these tags when needed.

1.1.2

XML describes structural and semantics, not formatting

The second thing to understand about XML is that the XML tag describes the structure and meaning of the document. It does not describe the formatting of page elements. The available style will add formatted information for documentation. The document itself only explains what tags include the documentation, not what the document looks like. As a control, the HTML document includes formatting, structural and semantic tags. It is a formatted tag that makes it transformed into bold. It is a semantic mark that means that the content is particularly important. It is a structural tag that indicates that the content is a unit in the table. In fact, some tags may have all these three meaning.

Mark can also be represented

20 pounds

The bold, first level title and page title of Helvetica font.

For example, in HTML, a song may be described using a definition header, defining data, disorderly list, and list items. But in fact, there is no one in these projects related to music. The song defined with HTML may be as follows:

Hot Cop

By Jacques Morali Henri Belolo and Victor Willis

Producer: Jacques Morali

Publisher: Polygram Records

Length: 6:20

Written: 978

Artist: village people

In XML, the same data may be marked as:

Jacques Morali

Henri Belolo

Victor Willis

Jacques Morali

Polygram Records

6:20

978

Village people

There is no universal mark in this list.

with

But use a meaningful mark, such as

,

转载请注明原文地址:https://www.9cbs.com/read-20761.html

New Post(0)