Introduction to xml and xml tag elements, xml tag _ php Tutorial

Source: Internet
Author: User
Tags getting started with php
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...

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.