XML Basic Introduction to PHP operation XML and XML tag elements, XML tag _php tutorial

Source: Internet
Author: User
Tags getting started with php

XML basic introduction and XML tag elements for getting Started with PHP operation XML, XML tags


In this paper, the XML basic introduction and XML tag elements of PHP operation XML are described. Share to everyone for your reference. The specific analysis is as follows:

This is explained by an XML instance:
Copy the Code code as follows: <?xml version= "1.0" encoding= "Utf-8" standalone= "no"?>


Joe
Woman
23


Zhou yu
Man
27


First, the XML declaration:

<?xml version= "1.0" encoding= "Utf-8" standalone= "no"?>
(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.

I hope this article is helpful to everyone's PHP operation XML programming.

http://www.bkjia.com/PHPjc/946741.html www.bkjia.com true http://www.bkjia.com/PHPjc/946741.html techarticle XML Basic Introduction to PHP operation XML and XML tag elements, XML tags in this paper, we describe the basic XML introduction of XML and XML tag elements. Share to everyone for your reference. Specific ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.