Basic Introduction to xml and xml tag elements and xml tags for getting started with xml operations in php. Introduction to xml and xml tag elements for getting started with xml for php operations. This document describes the basic introduction to xml and xml tag elements for getting started with xml for php operations. Share it with you for your reference. Basic Introduction to xml and xml tag elements, xml tags
This article describes the basic introduction to xml and the xml tag elements for getting started with xml for php operations. Share it with you for your reference. The specific analysis is as follows:
The following describes how to use an xml instance:
The code is as follows:
<? Xml version = "1.0" encoding = "UTF-8" standalone = "no"?>
Xiaoqiao
Female
23
Zhou Yu
Male
27
I. xml declaration:
<? Xml version = "1.0" encoding = "UTF-8" standalone = "no"?>
(1) the xml declaration should be placed in the first line of the document;
(2) encoding: the character encoding of a document, such as UTF-8 and gb2312.
(3) standalone: The value is yes or no, which indicates whether the document definition is independent, that is, whether it is associated with other documents. The default value is no.
II. root element
Package in the outermost layer It is the root element. Each xml document must have only one root element.
III. xml elements, tags, and nodes
, , ,All are xml elements, also known as labels or nodes. Of course, the root element is also an element.
If the tag contains no content, as shown in figure Can be abbreviated . Even if it is written When the browser is opened, it is also displayed
4. spaces and line breaks in labels
Labels contain spaces and line breaks. xml documents treat spaces and line breaks as the original content. Therefore, pay special attention to programming.
V. xml label naming rules
(1) case sensitive;
(2) it cannot start with a number or;
(3) it cannot begin with xml, XML, Xml, or other special characters;
(4) it cannot contain spaces;
(5) cannot contain colons.
I hope this article will help you with the XML programming for php operations.
Examples in this article describes the basic introduction to xml and the xml tag elements for getting started with php xml operations. Share it with you for your reference. Details...