Home  >  Article  >  Backend Development  >  Approaching XML (1)

Approaching XML (1)

黄舟
黄舟Original
2017-02-10 16:26:591580browse

XML - Extensible Markup Language

What is the markup language?

Any part of the document that you do not want to be printed out (not the content of the real document, just like reading a textbook and making notes). What is the function of

?

conveys additional information about the document itself. For example: how to display a certain part of the marked document, what the certain part means, etc.

The role of XML

Easy to read, standard format, any language has a built-in XML analysis engine, there is no need to write a separate file analysis engine.

A formatted way to store data, and it is a text file, which we can easily open with Notepad at any time, unlike some specialized software like Excel and Word.

The file formats after Office 2007 are docx, xlsx, and pptx, all of which are xml. For example, for a file in docx format, change its extension to a compressed file in rar format. Then when you open it, you will find that they are all files in xml format. There are unexpected gains when opening these xml files! Approaching XML (1)


XML syntax features

(1) Strictly case-sensitive

(2) There is and is only one root node

(3) If there is a start tag, there must be an end tag

(4) Attributes must use double quotes

(5) No predefined tags are different from HTML

(6) Documentation statement:

(7) Comments:

(8 ) CDATA area: that is, the original text-

(9) Comment encoding issue, the actual encoding of the text file must be consistent with the encoding in the document declaration.

PSApproaching XML (1)

Common markup languages ​​are: HTML, SGML

The difference between XML and HTML

(1 ) has and has only one root element

(2) Elements in XML must be closed

(3) Attribute values ​​of elements in XML must be in quotes

(4) XML is case sensitive

After the XML is written, you can use the browser to view it. If you make a mistake, the browser will prompt "F12". If there is obviously nothing wrong, the browser will still prompt an error, it may be a file encoding problem.

The above is the content of Approaching XML (1). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn