Home  >  Article  >  Backend Development  >  Understand the Xml format

Understand the Xml format

高洛峰
高洛峰Original
2016-12-19 16:04:471530browse

Most of the Xml I know is used as a data transmission or storage format. In Ajax, Xml is used to transmit data; in WebService, Xml is still provided as a data interface; in Config files, Xml is used to save configuration information... With the increasing popularity of the Microsoft .NET platform, Xml The use is also becoming increasingly widespread. To quote someone else: There is air and water in the world, and there is Xml among programmers. This is enough to see the importance of Xml. Since Xml is so important, how to create an Xml document?

1. Understand the format of the Xml document

The syntax of Xml is much stricter than that of HTML. It requires that each tag has a start and end tag, for example: the start tag , the end tag is ; or written together: ; In addition, the Xml document also contains the document's Header information, for example: ; these contents are written very clearly in Xiaoyang's blog: http://www.cnblogs.com/yanyangtian/category/179295.html, I hope Friends who need it can go there and have a clear look, and there will be no duplication of work here.

2. Create an Xml document

Once we understand the Xml format, we can create an Xml document with the correct format.

First, create a new text document and name the document book.xml.

Then, use Notepad to open this file. Enter the content in it:

                                                                                                                                                              

                                                                   2009-03-23

                                                                                                                   Such an Xml document is created. When we need to use it later, we just need to load it into our application. Regarding how to load Xml documents in the program, I will mention it in a future article. Please stay tuned.

For more information about Xml format related articles, please pay attention to the PHP Chinese website!

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