XML basic introduction and XML tag elements for getting Started with PHP operation XML
This is explained by an XML instance:
The code is as follows:
Joe
Woman
23
Zhou yu
Man
27
First, the XML declaration:
(1), the XML declaration to be placed in the first line of the document;
(2), Encoding: Document character encoding, such as Utf-8, gb2312, and so on.
(3), standalone: A value of Yes or no, optional, indicates whether the document definition is independent, that is, whether it is associated with other documents. The default is No.
Second, the root element
Wrapped at the outermost layer as the root element, each XML document must have only one root element.
Iii. XML elements/tags/nodes
,,, and so on are elements of XML, which are also known as tags or nodes. Of course, the root element is also an element.
If there is no content in the label, such as there is no entity content , you can abbreviate it. Even if it is written, the browser opens, it is also displayed
Iv. spaces and line breaks in labels
Spaces and line breaks appear in the label, and the XML document treats the spaces and line breaks as the original content. Therefore, you should pay special attention when programming.
V. Naming conventions FOR XML tags
(1) Case-sensitive;
(2) cannot begin with a number or "_";
(3) cannot start with special characters such as XML, XML, XML, etc.;
(4) cannot contain spaces;
(5) cannot contain colons.
http://www.bkjia.com/PHPjc/947792.html www.bkjia.com true http://www.bkjia.com/PHPjc/947792.html techarticle The basic XML Introduction to PHP operation XML and XML tag elements are explained in XML instances: The code is as follows:? xml version=1.0 encoding=utf-8 Standalone=no? Class student name Joe Cole/ Name Sex girl/s ...