XML (Extensible Markup Language)
]>0x584A holle,world! -> 跟随0x584A、学习XML.. ]]>
Let's take a look at the specific display effect after running in the browser:
1.png
I believe that students who have been online for a long time have seen files with the suffix .xml. This is what we call XML files.
First after HTML became popular, the W3C organization felt that the limitations of the HTML language were too great, so it introduced XML for the purpose of Replace HTML language .
Of course, it seems that W3C’s plan has not been successful. (However, there are no eggs⊙﹏⊙)
Although XML has not replaced HTML, its unique characteristics allow it to continue to this day. .
优点: 1. 高度自定义[标签] 2. 不同语言中的数据流通规范 3. XML是用来描述数据的。而在HTML中,数据是写在HTML标签中的。 4. XML设计是用来描述数据的:重点是什么是数据,怎么存放数据。而HTML则是用来显示数据:重点是怎么显示数据,及怎么更好的显示数据。
Explain XML in one sentence: XML is a cross-platform, software- and hardware-independent tool for processing information (a tool for data manipulation and data transmission)
Um.. Let me share a joke with you:
Q: When should I use XML?
Answer: You can write in your resume that you know XML..
Based on the first piece of code above , let us analyze it step by step.
The first one is to declare first, declare that this XML version is 1.0, and use UTF-8character set to identify it .
The following code is used for DTDconstraints.
]>
Then someone asked:
What is DTD?
Let’s take a look at the explanation on W3C:
Document type definition (DTD) can define legal XML document building blocks. It uses a series of legal elements to define the structure of the document.
Uh... (Actually, it's just bullshit, it's the same as not saying it...)
Okay, no more complaining. In fact, it sets restrictions on the XML elements, attributes, etc. we write. The structure we write must follow DTD constraints.
Let us continue to look at the following code:
0x584A holle,world! -> 跟随0x584A、学习XML.. ]]>
Did you find anything?
Yes, yes, it is a tree structure. Let's take a look at the DTD constraint. The root node class is first defined, and then the person element is defined and there are four elements inside the
person element. Elements name, time, msg, data.
There is a strange thing among them, we call it CDATA section
, only the text in the section will be ignored by the parser, so it outputs it as isSpecial symbols<
、>
, etc...
好了、至此关于XML的快速入门结束了,你学会了多少呢? 下一章让我们来学习XML的语法、元素及属性吧 o(∩_∩)o
The above is the detailed content of Quick Start Tutorial for XML. For more information, please follow other related articles on the PHP Chinese website!